use m_IsSaving flag for saving RouterInfo

This commit is contained in:
orignal
2025-01-29 16:02:31 -05:00
parent e4ba07a540
commit adc230acde
2 changed files with 8 additions and 17 deletions

View File

@@ -13,7 +13,6 @@
#include <string>
#include <memory>
#include <random>
#include <future>
#include <unordered_set>
#include <boost/asio.hpp>
#include "Identity.h"
@@ -267,9 +266,9 @@ namespace garlic
bool m_IsHiddenMode; // not publish
mutable std::mutex m_RouterInfoMutex;
std::mt19937 m_Rng;
std::future<void> m_SavingRouterInfo;
std::shared_ptr<i2p::data::RouterInfo::Buffer> m_SaveBuffer;
std::mutex m_SaveBufferMutex; // TODO: make m_SaveBuffer atomic
std::atomic<bool> m_IsSaving;
};
extern RouterContext context;