BIP144: Handshake and relay (receiver side)

Service bit logic by Nicolas Dorier.

Only download blocks from witness peers after fork.
This commit is contained in:
Pieter Wuille
2015-11-17 00:20:49 +01:00
parent 8b49040854
commit b8a97498df
6 changed files with 60 additions and 9 deletions

View File

@@ -1377,6 +1377,18 @@ bool AppInit2(boost::thread_group& threadGroup, CScheduler& scheduler)
}
}
if (Params().GetConsensus().vDeployments[Consensus::DEPLOYMENT_SEGWIT].nTimeout != 0) {
// Only advertize witness capabilities if they have a reasonable start time.
// This allows us to have the code merged without a defined softfork, by setting its
// end time to 0.
// Note that setting NODE_WITNESS is never required: the only downside from not
// doing so is that after activation, no upgraded nodes will fetch from you.
nLocalServices = ServiceFlags(nLocalServices | NODE_WITNESS);
// Only care about others providing witness capabilities if there is a softfork
// defined.
nRelevantServices = ServiceFlags(nRelevantServices | NODE_WITNESS);
}
// ********************************************************* Step 10: import blocks
if (mapArgs.count("-blocknotify"))