@@ -669,12 +669,12 @@ static void MaybeSetPeerAsAnnouncingHeaderAndIDs(NodeId nodeid, CConnman& connma
669
669
// As per BIP152, we only get 3 of our peers to announce
670
670
// blocks using compact encodings.
671
671
connman.ForNode (lNodesAnnouncingHeaderAndIDs.front (), [&connman, nCMPCTBLOCKVersion](CNode* pnodeStop){
672
- connman.PushMessage (pnodeStop, CNetMsgMaker (pnodeStop->GetSendVersion ()).Make (NetMsgType::SENDCMPCT, /* fAnnounceUsingCMPCTBLOCK=*/ false , nCMPCTBLOCKVersion));
672
+ connman.PushMessage (pnodeStop, CNetMsgMaker (pnodeStop->GetCommonVersion ()).Make (NetMsgType::SENDCMPCT, /* fAnnounceUsingCMPCTBLOCK=*/ false , nCMPCTBLOCKVersion));
673
673
return true ;
674
674
});
675
675
lNodesAnnouncingHeaderAndIDs.pop_front ();
676
676
}
677
- connman.PushMessage (pfrom, CNetMsgMaker (pfrom->GetSendVersion ()).Make (NetMsgType::SENDCMPCT, /* fAnnounceUsingCMPCTBLOCK=*/ true , nCMPCTBLOCKVersion));
677
+ connman.PushMessage (pfrom, CNetMsgMaker (pfrom->GetCommonVersion ()).Make (NetMsgType::SENDCMPCT, /* fAnnounceUsingCMPCTBLOCK=*/ true , nCMPCTBLOCKVersion));
678
678
lNodesAnnouncingHeaderAndIDs.push_back (pfrom->GetId ());
679
679
return true ;
680
680
});
@@ -1585,7 +1585,7 @@ void static ProcessGetBlockData(CNode& pfrom, const CChainParams& chainparams, c
1585
1585
LogPrint (BCLog::NET, " %s: ignoring request from peer=%i for old block that isn't in the main chain\n " , __func__, pfrom.GetId ());
1586
1586
}
1587
1587
}
1588
- const CNetMsgMaker msgMaker (pfrom.GetSendVersion ());
1588
+ const CNetMsgMaker msgMaker (pfrom.GetCommonVersion ());
1589
1589
// disconnect node in case we have reached the outbound limit for serving historical blocks
1590
1590
if (send &&
1591
1591
connman.OutboundTargetReached (true ) &&
@@ -1728,7 +1728,7 @@ void static ProcessGetData(CNode& pfrom, const CChainParams& chainparams, CConnm
1728
1728
1729
1729
std::deque<CInv>::iterator it = pfrom.vRecvGetData .begin ();
1730
1730
std::vector<CInv> vNotFound;
1731
- const CNetMsgMaker msgMaker (pfrom.GetSendVersion ());
1731
+ const CNetMsgMaker msgMaker (pfrom.GetCommonVersion ());
1732
1732
1733
1733
const std::chrono::seconds now = GetTime<std::chrono::seconds>();
1734
1734
// Get last mempool request time
@@ -1834,14 +1834,14 @@ void PeerManager::SendBlockTransactions(CNode& pfrom, const CBlock& block, const
1834
1834
resp.txn [i] = block.vtx [req.indexes [i]];
1835
1835
}
1836
1836
LOCK (cs_main);
1837
- const CNetMsgMaker msgMaker (pfrom.GetSendVersion ());
1837
+ const CNetMsgMaker msgMaker (pfrom.GetCommonVersion ());
1838
1838
int nSendFlags = State (pfrom.GetId ())->fWantsCmpctWitness ? 0 : SERIALIZE_TRANSACTION_NO_WITNESS;
1839
1839
m_connman.PushMessage (&pfrom, msgMaker.Make (nSendFlags, NetMsgType::BLOCKTXN, resp));
1840
1840
}
1841
1841
1842
1842
void PeerManager::ProcessHeadersMessage (CNode& pfrom, const std::vector<CBlockHeader>& headers, bool via_compact_block)
1843
1843
{
1844
- const CNetMsgMaker msgMaker (pfrom.GetSendVersion ());
1844
+ const CNetMsgMaker msgMaker (pfrom.GetCommonVersion ());
1845
1845
size_t nCount = headers.size ();
1846
1846
1847
1847
if (nCount == 0 ) {
@@ -2211,7 +2211,7 @@ static void ProcessGetCFilters(CNode& peer, CDataStream& vRecv, const CChainPara
2211
2211
}
2212
2212
2213
2213
for (const auto & filter : filters) {
2214
- CSerializedNetMsg msg = CNetMsgMaker (peer.GetSendVersion ())
2214
+ CSerializedNetMsg msg = CNetMsgMaker (peer.GetCommonVersion ())
2215
2215
.Make (NetMsgType::CFILTER, filter);
2216
2216
connman.PushMessage (&peer, std::move (msg));
2217
2217
}
@@ -2263,7 +2263,7 @@ static void ProcessGetCFHeaders(CNode& peer, CDataStream& vRecv, const CChainPar
2263
2263
return ;
2264
2264
}
2265
2265
2266
- CSerializedNetMsg msg = CNetMsgMaker (peer.GetSendVersion ())
2266
+ CSerializedNetMsg msg = CNetMsgMaker (peer.GetCommonVersion ())
2267
2267
.Make (NetMsgType::CFHEADERS,
2268
2268
filter_type_ser,
2269
2269
stop_index->GetBlockHash (),
@@ -2315,7 +2315,7 @@ static void ProcessGetCFCheckPt(CNode& peer, CDataStream& vRecv, const CChainPar
2315
2315
}
2316
2316
}
2317
2317
2318
- CSerializedNetMsg msg = CNetMsgMaker (peer.GetSendVersion ())
2318
+ CSerializedNetMsg msg = CNetMsgMaker (peer.GetCommonVersion ())
2319
2319
.Make (NetMsgType::CFCHECKPT,
2320
2320
filter_type_ser,
2321
2321
stop_index->GetBlockHash (),
@@ -2406,10 +2406,10 @@ void PeerManager::ProcessMessage(CNode& pfrom, const std::string& msg_type, CDat
2406
2406
PushNodeVersion (pfrom, m_connman, GetAdjustedTime ());
2407
2407
2408
2408
if (nVersion >= WTXID_RELAY_VERSION) {
2409
- m_connman.PushMessage (&pfrom, CNetMsgMaker (INIT_PROTO_VERSION ).Make (NetMsgType::WTXIDRELAY));
2409
+ m_connman.PushMessage (&pfrom, CNetMsgMaker (nSendVersion ).Make (NetMsgType::WTXIDRELAY));
2410
2410
}
2411
2411
2412
- m_connman.PushMessage (&pfrom, CNetMsgMaker (INIT_PROTO_VERSION ).Make (NetMsgType::VERACK));
2412
+ m_connman.PushMessage (&pfrom, CNetMsgMaker (nSendVersion ).Make (NetMsgType::VERACK));
2413
2413
2414
2414
pfrom.nServices = nServices;
2415
2415
pfrom.SetAddrLocal (addrMe);
@@ -2431,7 +2431,7 @@ void PeerManager::ProcessMessage(CNode& pfrom, const std::string& msg_type, CDat
2431
2431
}
2432
2432
2433
2433
// Change version
2434
- pfrom.SetSendVersion (nSendVersion);
2434
+ pfrom.SetCommonVersion (nSendVersion);
2435
2435
pfrom.nVersion = nVersion;
2436
2436
2437
2437
if ((nServices & NODE_WITNESS))
@@ -2520,11 +2520,11 @@ void PeerManager::ProcessMessage(CNode& pfrom, const std::string& msg_type, CDat
2520
2520
}
2521
2521
2522
2522
// At this point, the outgoing message serialization version can't change.
2523
- const CNetMsgMaker msgMaker (pfrom.GetSendVersion ());
2523
+ const CNetMsgMaker msgMaker (pfrom.GetCommonVersion ());
2524
2524
2525
2525
if (msg_type == NetMsgType::VERACK)
2526
2526
{
2527
- pfrom.SetRecvVersion (std::min (pfrom.nVersion .load (), PROTOCOL_VERSION));
2527
+ pfrom.SetCommonVersion (std::min (pfrom.nVersion .load (), PROTOCOL_VERSION));
2528
2528
2529
2529
if (!pfrom.IsInboundConn ()) {
2530
2530
// Mark this node as currently connected, so we update its timestamp later.
@@ -3872,7 +3872,7 @@ bool PeerManager::ProcessMessages(CNode* pfrom, std::atomic<bool>& interruptMsgP
3872
3872
}
3873
3873
CNetMessage& msg (msgs.front ());
3874
3874
3875
- msg.SetVersion (pfrom->GetRecvVersion ());
3875
+ msg.SetVersion (pfrom->GetCommonVersion ());
3876
3876
// Check network magic
3877
3877
if (!msg.m_valid_netmagic ) {
3878
3878
LogPrint (BCLog::NET, " PROCESSMESSAGE: INVALID MESSAGESTART %s peer=%d\n " , SanitizeString (msg.m_command ), pfrom->GetId ());
@@ -3920,7 +3920,7 @@ void PeerManager::ConsiderEviction(CNode& pto, int64_t time_in_seconds)
3920
3920
AssertLockHeld (cs_main);
3921
3921
3922
3922
CNodeState &state = *State (pto.GetId ());
3923
- const CNetMsgMaker msgMaker (pto.GetSendVersion ());
3923
+ const CNetMsgMaker msgMaker (pto.GetCommonVersion ());
3924
3924
3925
3925
if (!state.m_chain_sync .m_protect && pto.IsOutboundOrBlockRelayConn () && state.fSyncStarted ) {
3926
3926
// This is an outbound peer subject to disconnection if they don't
@@ -4082,7 +4082,7 @@ bool PeerManager::SendMessages(CNode* pto)
4082
4082
return true ;
4083
4083
4084
4084
// If we get here, the outgoing message serialization version is set and can't change.
4085
- const CNetMsgMaker msgMaker (pto->GetSendVersion ());
4085
+ const CNetMsgMaker msgMaker (pto->GetCommonVersion ());
4086
4086
4087
4087
//
4088
4088
// Message: ping
0 commit comments