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:
12
src/init.cpp
12
src/init.cpp
@@ -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"))
|
||||
|
||||
Reference in New Issue
Block a user