mirror of
https://github.com/Retropex/bitcoin.git
synced 2025-06-02 23:42:33 +02:00
net: Ensure CNode.cleanSubVer is always assigned before nVersion
This commit is contained in:
parent
c2a21c0670
commit
df874f848a
@ -3224,6 +3224,10 @@ void PeerManagerImpl::ProcessMessage(CNode& pfrom, const std::string& msg_type,
|
|||||||
// Change version
|
// Change version
|
||||||
const int greatest_common_version = std::min(nVersion, PROTOCOL_VERSION);
|
const int greatest_common_version = std::min(nVersion, PROTOCOL_VERSION);
|
||||||
pfrom.SetCommonVersion(greatest_common_version);
|
pfrom.SetCommonVersion(greatest_common_version);
|
||||||
|
{
|
||||||
|
LOCK(pfrom.m_subver_mutex);
|
||||||
|
pfrom.cleanSubVer = cleanSubVer;
|
||||||
|
}
|
||||||
pfrom.nVersion = nVersion;
|
pfrom.nVersion = nVersion;
|
||||||
|
|
||||||
const CNetMsgMaker msg_maker(greatest_common_version);
|
const CNetMsgMaker msg_maker(greatest_common_version);
|
||||||
@ -3246,10 +3250,6 @@ void PeerManagerImpl::ProcessMessage(CNode& pfrom, const std::string& msg_type,
|
|||||||
pfrom.m_has_all_wanted_services = HasAllDesirableServiceFlags(nServices);
|
pfrom.m_has_all_wanted_services = HasAllDesirableServiceFlags(nServices);
|
||||||
peer->m_their_services = nServices;
|
peer->m_their_services = nServices;
|
||||||
pfrom.SetAddrLocal(addrMe);
|
pfrom.SetAddrLocal(addrMe);
|
||||||
{
|
|
||||||
LOCK(pfrom.m_subver_mutex);
|
|
||||||
pfrom.cleanSubVer = cleanSubVer;
|
|
||||||
}
|
|
||||||
peer->m_starting_height = starting_height;
|
peer->m_starting_height = starting_height;
|
||||||
|
|
||||||
// We only initialize the m_tx_relay data structure if:
|
// We only initialize the m_tx_relay data structure if:
|
||||||
|
Loading…
Reference in New Issue
Block a user