@@ -2870,23 +2870,20 @@ void PeerManagerImpl::ProcessMessage(CNode& pfrom, const std::string& msg_type,
2870
2870
}
2871
2871
2872
2872
if (msg_type == NetMsgType::SENDCMPCT) {
2873
- bool fAnnounceUsingCMPCTBLOCK = false ;
2874
- uint64_t nCMPCTBLOCKVersion = 0 ;
2875
- vRecv >> fAnnounceUsingCMPCTBLOCK >> nCMPCTBLOCKVersion ;
2873
+ bool sendcmpct_hb{ false } ;
2874
+ uint64_t sendcmpct_version{ 0 } ;
2875
+ vRecv >> sendcmpct_hb >> sendcmpct_version ;
2876
2876
2877
2877
// Only support compact block relay with witnesses
2878
- if (nCMPCTBLOCKVersion != CMPCTBLOCKS_VERSION) return ;
2878
+ if (sendcmpct_version != CMPCTBLOCKS_VERSION) return ;
2879
2879
2880
2880
LOCK (cs_main);
2881
- if (!State (pfrom.GetId ())->fProvidesHeaderAndIDs ) {
2882
- State (pfrom.GetId ())->fProvidesHeaderAndIDs = true ;
2883
- }
2884
- if (State (pfrom.GetId ())->fProvidesHeaderAndIDs ) {
2885
- State (pfrom.GetId ())->fPreferHeaderAndIDs = fAnnounceUsingCMPCTBLOCK ;
2886
- // save whether peer selects us as BIP152 high-bandwidth peer
2887
- // (receiving sendcmpct(1) signals high-bandwidth, sendcmpct(0) low-bandwidth)
2888
- pfrom.m_bip152_highbandwidth_from = fAnnounceUsingCMPCTBLOCK ;
2889
- }
2881
+ CNodeState* nodestate = State (pfrom.GetId ());
2882
+ nodestate->fProvidesHeaderAndIDs = true ;
2883
+ nodestate->fPreferHeaderAndIDs = sendcmpct_hb;
2884
+ // save whether peer selects us as BIP152 high-bandwidth peer
2885
+ // (receiving sendcmpct(1) signals high-bandwidth, sendcmpct(0) low-bandwidth)
2886
+ pfrom.m_bip152_highbandwidth_from = sendcmpct_hb;
2890
2887
return ;
2891
2888
}
2892
2889
0 commit comments