mirror of
https://github.com/Retropex/bitcoin.git
synced 2025-06-04 08:22:36 +02:00
[net] Change addr send times fields to be guarded by new mutex
This commit is contained in:
parent
c02fa47baa
commit
4ad4abcf07
@ -548,8 +548,9 @@ public:
|
|||||||
std::vector<CAddress> vAddrToSend;
|
std::vector<CAddress> vAddrToSend;
|
||||||
std::unique_ptr<CRollingBloomFilter> m_addr_known{nullptr};
|
std::unique_ptr<CRollingBloomFilter> m_addr_known{nullptr};
|
||||||
bool fGetAddr{false};
|
bool fGetAddr{false};
|
||||||
std::chrono::microseconds m_next_addr_send GUARDED_BY(cs_sendProcessing){0};
|
Mutex m_addr_send_times_mutex;
|
||||||
std::chrono::microseconds m_next_local_addr_send GUARDED_BY(cs_sendProcessing){0};
|
std::chrono::microseconds m_next_addr_send GUARDED_BY(m_addr_send_times_mutex){0};
|
||||||
|
std::chrono::microseconds m_next_local_addr_send GUARDED_BY(m_addr_send_times_mutex){0};
|
||||||
|
|
||||||
struct TxRelay {
|
struct TxRelay {
|
||||||
mutable RecursiveMutex cs_filter;
|
mutable RecursiveMutex cs_filter;
|
||||||
|
@ -4189,6 +4189,8 @@ bool PeerManagerImpl::SendMessages(CNode* pto)
|
|||||||
CNodeState &state = *State(pto->GetId());
|
CNodeState &state = *State(pto->GetId());
|
||||||
|
|
||||||
// Address refresh broadcast
|
// Address refresh broadcast
|
||||||
|
{
|
||||||
|
LOCK(pto->m_addr_send_times_mutex);
|
||||||
|
|
||||||
if (fListen && pto->RelayAddrsWithConn() &&
|
if (fListen && pto->RelayAddrsWithConn() &&
|
||||||
!m_chainman.ActiveChainstate().IsInitialBlockDownload() &&
|
!m_chainman.ActiveChainstate().IsInitialBlockDownload() &&
|
||||||
@ -4249,6 +4251,7 @@ bool PeerManagerImpl::SendMessages(CNode* pto)
|
|||||||
if (pto->vAddrToSend.capacity() > 40)
|
if (pto->vAddrToSend.capacity() > 40)
|
||||||
pto->vAddrToSend.shrink_to_fit();
|
pto->vAddrToSend.shrink_to_fit();
|
||||||
}
|
}
|
||||||
|
} // pto->m_addr_send_times_mutex
|
||||||
|
|
||||||
// Start block sync
|
// Start block sync
|
||||||
if (pindexBestHeader == nullptr)
|
if (pindexBestHeader == nullptr)
|
||||||
|
Loading…
Reference in New Issue
Block a user