From 06128da751371797683eabb577298a4966b2ce28 Mon Sep 17 00:00:00 2001 From: Matt Corallo Date: Mon, 3 Oct 2016 13:00:14 -0400 Subject: 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. --- src/main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main.cpp b/src/main.cpp index 437e972382..40c31b6ca6 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -4922,7 +4922,7 @@ void static ProcessGetData(CNode* pfrom, const Consensus::Params& consensusParam uint32_t GetFetchFlags(CNode* pfrom, CBlockIndex* pprev, const Consensus::Params& chainparams) { uint32_t nFetchFlags = 0; - if (IsWitnessEnabled(pprev, chainparams) && State(pfrom->GetId())->fHaveWitness) { + if ((pfrom->GetLocalServices() & NODE_WITNESS) && State(pfrom->GetId())->fHaveWitness) { nFetchFlags |= MSG_WITNESS_FLAG; } return nFetchFlags; -- cgit v1.2.3