@@ -1359,7 +1359,7 @@ void PeerManager::NewPoWValidBlock(const CBlockIndex *pindex, const std::shared_
1359
1359
LockAssertion lock (::cs_main);
1360
1360
1361
1361
// TODO: Avoid the repeated-serialization here
1362
- if (pnode->nVersion < INVALID_CB_NO_BAN_VERSION || pnode->fDisconnect )
1362
+ if (pnode->GetCommonVersion () < INVALID_CB_NO_BAN_VERSION || pnode->fDisconnect )
1363
1363
return ;
1364
1364
ProcessBlockAvailability (pnode->GetId ());
1365
1365
CNodeState &state = *State (pnode->GetId ());
@@ -2408,7 +2408,7 @@ void PeerManager::ProcessMessage(CNode& pfrom, const std::string& msg_type, CDat
2408
2408
pfrom.SetCommonVersion (greatest_common_version);
2409
2409
pfrom.nVersion = nVersion;
2410
2410
2411
- if (nVersion >= WTXID_RELAY_VERSION) {
2411
+ if (greatest_common_version >= WTXID_RELAY_VERSION) {
2412
2412
m_connman.PushMessage (&pfrom, CNetMsgMaker (greatest_common_version).Make (NetMsgType::WTXIDRELAY));
2413
2413
}
2414
2414
@@ -2500,7 +2500,7 @@ void PeerManager::ProcessMessage(CNode& pfrom, const std::string& msg_type, CDat
2500
2500
AddTimeData (pfrom.addr , nTimeOffset);
2501
2501
2502
2502
// If the peer is old enough to have the old alert system, send it the final alert.
2503
- if (pfrom. nVersion <= 70012 ) {
2503
+ if (greatest_common_version <= 70012 ) {
2504
2504
CDataStream finalAlert (ParseHex (" 60010000000000000000000000ffffff7f00000000ffffff7ffeffff7f01ffffff7f00000000ffffff7f00ffffff7f002f555247454e543a20416c657274206b657920636f6d70726f6d697365642c2075706772616465207265717569726564004630440220653febd6410f470f6bae11cad19c48413becb1ac2c17f908fd0fd53bdc3abd5202206d0e9c96fe88d4a0f01ed9dedae2b6f9e00da94cad0fecaae66ecf689bf71b50" ), SER_NETWORK, PROTOCOL_VERSION);
2505
2505
m_connman.PushMessage (&pfrom, CNetMsgMaker (greatest_common_version).Make (" alert" , finalAlert));
2506
2506
}
@@ -2533,14 +2533,14 @@ void PeerManager::ProcessMessage(CNode& pfrom, const std::string& msg_type, CDat
2533
2533
pfrom.m_tx_relay == nullptr ? " block-relay" : " full-relay" );
2534
2534
}
2535
2535
2536
- if (pfrom.nVersion >= SENDHEADERS_VERSION) {
2536
+ if (pfrom.GetCommonVersion () >= SENDHEADERS_VERSION) {
2537
2537
// Tell our peer we prefer to receive headers rather than inv's
2538
2538
// We send this to non-NODE NETWORK peers as well, because even
2539
2539
// non-NODE NETWORK peers can announce blocks (such as pruning
2540
2540
// nodes)
2541
2541
m_connman.PushMessage (&pfrom, msgMaker.Make (NetMsgType::SENDHEADERS));
2542
2542
}
2543
- if (pfrom.nVersion >= SHORT_IDS_BLOCKS_VERSION) {
2543
+ if (pfrom.GetCommonVersion () >= SHORT_IDS_BLOCKS_VERSION) {
2544
2544
// Tell our peer we are willing to provide version 1 or 2 cmpctblocks
2545
2545
// However, we do not request new block announcements using
2546
2546
// cmpctblock messages.
@@ -2566,7 +2566,7 @@ void PeerManager::ProcessMessage(CNode& pfrom, const std::string& msg_type, CDat
2566
2566
pfrom.fDisconnect = true ;
2567
2567
return ;
2568
2568
}
2569
- if (pfrom.nVersion >= WTXID_RELAY_VERSION) {
2569
+ if (pfrom.GetCommonVersion () >= WTXID_RELAY_VERSION) {
2570
2570
LOCK (cs_main);
2571
2571
if (!State (pfrom.GetId ())->m_wtxid_relay ) {
2572
2572
State (pfrom.GetId ())->m_wtxid_relay = true ;
@@ -3581,8 +3581,7 @@ void PeerManager::ProcessMessage(CNode& pfrom, const std::string& msg_type, CDat
3581
3581
}
3582
3582
3583
3583
if (msg_type == NetMsgType::PING) {
3584
- if (pfrom.nVersion > BIP0031_VERSION)
3585
- {
3584
+ if (pfrom.GetCommonVersion () > BIP0031_VERSION) {
3586
3585
uint64_t nonce = 0 ;
3587
3586
vRecv >> nonce;
3588
3587
// Echo the message back with the nonce. This allows for two useful features:
@@ -4100,7 +4099,7 @@ bool PeerManager::SendMessages(CNode* pto)
4100
4099
}
4101
4100
pto->fPingQueued = false ;
4102
4101
pto->m_ping_start = GetTime<std::chrono::microseconds>();
4103
- if (pto->nVersion > BIP0031_VERSION) {
4102
+ if (pto->GetCommonVersion () > BIP0031_VERSION) {
4104
4103
pto->nPingNonceSent = nonce;
4105
4104
m_connman.PushMessage (pto, msgMaker.Make (NetMsgType::PING, nonce));
4106
4105
} else {
@@ -4639,7 +4638,7 @@ bool PeerManager::SendMessages(CNode* pto)
4639
4638
//
4640
4639
// Message: feefilter
4641
4640
//
4642
- if (pto->m_tx_relay != nullptr && pto->nVersion >= FEEFILTER_VERSION && gArgs .GetBoolArg (" -feefilter" , DEFAULT_FEEFILTER) &&
4641
+ if (pto->m_tx_relay != nullptr && pto->GetCommonVersion () >= FEEFILTER_VERSION && gArgs .GetBoolArg (" -feefilter" , DEFAULT_FEEFILTER) &&
4643
4642
!pto->HasPermission (PF_FORCERELAY) // peers with the forcerelay permission should not filter txs to us
4644
4643
) {
4645
4644
CAmount currentFilter = m_mempool.GetMinFee (gArgs .GetArg (" -maxmempool" , DEFAULT_MAX_MEMPOOL_SIZE) * 1000000 ).GetFeePerK ();
0 commit comments