@@ -861,7 +861,7 @@ void PeerManagerImpl::MaybeSetPeerAsAnnouncingHeaderAndIDs(NodeId nodeid)
861
861
}
862
862
m_connman.ForNode (nodeid, [this ](CNode* pfrom) EXCLUSIVE_LOCKS_REQUIRED (::cs_main) {
863
863
AssertLockHeld (::cs_main);
864
- uint64_t nCMPCTBLOCKVersion = (pfrom-> GetLocalServices () & NODE_WITNESS) ? 2 : 1 ;
864
+ uint64_t nCMPCTBLOCKVersion = 2 ;
865
865
if (lNodesAnnouncingHeaderAndIDs.size () >= 3 ) {
866
866
// As per BIP152, we only get 3 of our peers to announce
867
867
// blocks using compact encodings.
@@ -1955,7 +1955,7 @@ void PeerManagerImpl::ProcessGetData(CNode& pfrom, Peer& peer, const std::atomic
1955
1955
1956
1956
static uint32_t GetFetchFlags (const CNode& pfrom) EXCLUSIVE_LOCKS_REQUIRED(cs_main) {
1957
1957
uint32_t nFetchFlags = 0 ;
1958
- if ((pfrom. GetLocalServices () & NODE_WITNESS) && State (pfrom.GetId ())->fHaveWitness ) {
1958
+ if (State (pfrom.GetId ())->fHaveWitness ) {
1959
1959
nFetchFlags |= MSG_WITNESS_FLAG;
1960
1960
}
1961
1961
return nFetchFlags;
@@ -2667,8 +2667,7 @@ void PeerManagerImpl::ProcessMessage(CNode& pfrom, const std::string& msg_type,
2667
2667
// they may wish to request compact blocks from us
2668
2668
bool fAnnounceUsingCMPCTBLOCK = false ;
2669
2669
uint64_t nCMPCTBLOCKVersion = 2 ;
2670
- if (pfrom.GetLocalServices () & NODE_WITNESS)
2671
- m_connman.PushMessage (&pfrom, msgMaker.Make (NetMsgType::SENDCMPCT, fAnnounceUsingCMPCTBLOCK , nCMPCTBLOCKVersion));
2670
+ m_connman.PushMessage (&pfrom, msgMaker.Make (NetMsgType::SENDCMPCT, fAnnounceUsingCMPCTBLOCK , nCMPCTBLOCKVersion));
2672
2671
nCMPCTBLOCKVersion = 1 ;
2673
2672
m_connman.PushMessage (&pfrom, msgMaker.Make (NetMsgType::SENDCMPCT, fAnnounceUsingCMPCTBLOCK , nCMPCTBLOCKVersion));
2674
2673
}
@@ -2686,7 +2685,7 @@ void PeerManagerImpl::ProcessMessage(CNode& pfrom, const std::string& msg_type,
2686
2685
bool fAnnounceUsingCMPCTBLOCK = false ;
2687
2686
uint64_t nCMPCTBLOCKVersion = 0 ;
2688
2687
vRecv >> fAnnounceUsingCMPCTBLOCK >> nCMPCTBLOCKVersion;
2689
- if (nCMPCTBLOCKVersion == 1 || ((pfrom. GetLocalServices () & NODE_WITNESS) && nCMPCTBLOCKVersion == 2 ) ) {
2688
+ if (nCMPCTBLOCKVersion == 1 || nCMPCTBLOCKVersion == 2 ) {
2690
2689
LOCK (cs_main);
2691
2690
// fProvidesHeaderAndIDs is used to "lock in" version of compact blocks we send (fWantsCmpctWitness)
2692
2691
if (!State (pfrom.GetId ())->fProvidesHeaderAndIDs ) {
@@ -2700,10 +2699,7 @@ void PeerManagerImpl::ProcessMessage(CNode& pfrom, const std::string& msg_type,
2700
2699
pfrom.m_bip152_highbandwidth_from = fAnnounceUsingCMPCTBLOCK ;
2701
2700
}
2702
2701
if (!State (pfrom.GetId ())->fSupportsDesiredCmpctVersion ) {
2703
- if (pfrom.GetLocalServices () & NODE_WITNESS)
2704
- State (pfrom.GetId ())->fSupportsDesiredCmpctVersion = (nCMPCTBLOCKVersion == 2 );
2705
- else
2706
- State (pfrom.GetId ())->fSupportsDesiredCmpctVersion = (nCMPCTBLOCKVersion == 1 );
2702
+ State (pfrom.GetId ())->fSupportsDesiredCmpctVersion = (nCMPCTBLOCKVersion == 2 );
2707
2703
}
2708
2704
}
2709
2705
return ;
0 commit comments