aboutsummaryrefslogtreecommitdiff
path: root/src/net_processing.cpp
diff options
context:
space:
mode:
authorJohn Newbery <john@johnnewbery.com>2021-01-02 15:17:53 +0000
committerJohn Newbery <john@johnnewbery.com>2022-05-15 15:37:56 -0400
commit25edb2b7bd4c41156fba09d0033a978e362435af (patch)
tree3d290c1a6040d1db519b4e9d5631bf9bba603dc6 /src/net_processing.cpp
parent42882fc8fc2ef5c58eb963f7f1e852dd43de6c65 (diff)
[net processing] Simplify `sendcmpct` processing
nCMPCTBLOCKVersion must always be 2 when processing.
Diffstat (limited to 'src/net_processing.cpp')
-rw-r--r--src/net_processing.cpp8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/net_processing.cpp b/src/net_processing.cpp
index d9c615c4be..f7c51ab6ab 100644
--- a/src/net_processing.cpp
+++ b/src/net_processing.cpp
@@ -2891,17 +2891,15 @@ void PeerManagerImpl::ProcessMessage(CNode& pfrom, const std::string& msg_type,
// fProvidesHeaderAndIDs is used to "lock in" version of compact blocks we send (fWantsCmpctWitness)
if (!State(pfrom.GetId())->fProvidesHeaderAndIDs) {
State(pfrom.GetId())->fProvidesHeaderAndIDs = true;
- State(pfrom.GetId())->fWantsCmpctWitness = nCMPCTBLOCKVersion == 2;
+ State(pfrom.GetId())->fWantsCmpctWitness = true;
}
- if (State(pfrom.GetId())->fWantsCmpctWitness == (nCMPCTBLOCKVersion == 2)) { // ignore later version announces
+ if (State(pfrom.GetId())->fWantsCmpctWitness) {
State(pfrom.GetId())->fPreferHeaderAndIDs = fAnnounceUsingCMPCTBLOCK;
// save whether peer selects us as BIP152 high-bandwidth peer
// (receiving sendcmpct(1) signals high-bandwidth, sendcmpct(0) low-bandwidth)
pfrom.m_bip152_highbandwidth_from = fAnnounceUsingCMPCTBLOCK;
}
- if (!State(pfrom.GetId())->fSupportsDesiredCmpctVersion) {
- State(pfrom.GetId())->fSupportsDesiredCmpctVersion = (nCMPCTBLOCKVersion == 2);
- }
+ State(pfrom.GetId())->fSupportsDesiredCmpctVersion = true;
return;
}