aboutsummaryrefslogtreecommitdiff
path: root/src/main.cpp
diff options
context:
space:
mode:
authorMatt Corallo <[email protected]>2016-10-03 13:00:14 -0400
committerPieter Wuille <[email protected]>2016-10-04 18:24:10 +0200
commit06128da751371797683eabb577298a4966b2ce28 (patch)
tree278be3e422c3eba73e3df7dae463bc62b4938c0a /src/main.cpp
parentMerge #8848: Add NULLDUMMY verify flag in bitcoinconsensus.h (diff)
downloaddiscoin-06128da751371797683eabb577298a4966b2ce28.tar.xz
discoin-06128da751371797683eabb577298a4966b2ce28.zip
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.
Diffstat (limited to 'src/main.cpp')
-rw-r--r--src/main.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/main.cpp b/src/main.cpp
index 437e97238..40c31b6ca 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;