Skip to content

Commit 06128da

Browse files
TheBlueMattsipa
authored andcommitted
Make GetFetchFlags always request witness objects from witness peers
This fixes a bug where we might (in exceedingly rare circumstances) accidentally ban a node for sending us the first (potentially few) segwit blocks in non-segwit mode.
1 parent d7615af commit 06128da

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/main.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4922,7 +4922,7 @@ void static ProcessGetData(CNode* pfrom, const Consensus::Params& consensusParam
49224922

49234923
uint32_t GetFetchFlags(CNode* pfrom, CBlockIndex* pprev, const Consensus::Params& chainparams) {
49244924
uint32_t nFetchFlags = 0;
4925-
if (IsWitnessEnabled(pprev, chainparams) && State(pfrom->GetId())->fHaveWitness) {
4925+
if ((pfrom->GetLocalServices() & NODE_WITNESS) && State(pfrom->GetId())->fHaveWitness) {
49264926
nFetchFlags |= MSG_WITNESS_FLAG;
49274927
}
49284928
return nFetchFlags;

0 commit comments

Comments
 (0)