Skip to content

Commit 25edb2b

Browse files
committed
[net processing] Simplify sendcmpct processing
nCMPCTBLOCKVersion must always be 2 when processing.
1 parent 42882fc commit 25edb2b

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

src/net_processing.cpp

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2891,17 +2891,15 @@ void PeerManagerImpl::ProcessMessage(CNode& pfrom, const std::string& msg_type,
28912891
// fProvidesHeaderAndIDs is used to "lock in" version of compact blocks we send (fWantsCmpctWitness)
28922892
if (!State(pfrom.GetId())->fProvidesHeaderAndIDs) {
28932893
State(pfrom.GetId())->fProvidesHeaderAndIDs = true;
2894-
State(pfrom.GetId())->fWantsCmpctWitness = nCMPCTBLOCKVersion == 2;
2894+
State(pfrom.GetId())->fWantsCmpctWitness = true;
28952895
}
2896-
if (State(pfrom.GetId())->fWantsCmpctWitness == (nCMPCTBLOCKVersion == 2)) { // ignore later version announces
2896+
if (State(pfrom.GetId())->fWantsCmpctWitness) {
28972897
State(pfrom.GetId())->fPreferHeaderAndIDs = fAnnounceUsingCMPCTBLOCK;
28982898
// save whether peer selects us as BIP152 high-bandwidth peer
28992899
// (receiving sendcmpct(1) signals high-bandwidth, sendcmpct(0) low-bandwidth)
29002900
pfrom.m_bip152_highbandwidth_from = fAnnounceUsingCMPCTBLOCK;
29012901
}
2902-
if (!State(pfrom.GetId())->fSupportsDesiredCmpctVersion) {
2903-
State(pfrom.GetId())->fSupportsDesiredCmpctVersion = (nCMPCTBLOCKVersion == 2);
2904-
}
2902+
State(pfrom.GetId())->fSupportsDesiredCmpctVersion = true;
29052903
return;
29062904
}
29072905

0 commit comments

Comments
 (0)