mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-13 12:33:42 +02:00
Merge 349632e022 into merged_master (Bitcoin PR bitcoin/bitcoin#30807)
This commit is contained in:
commit
a4f8f89bf4
7 changed files with 147 additions and 11 deletions
16
src/init.cpp
16
src/init.cpp
|
|
@ -1734,7 +1734,12 @@ bool AppInitMain(NodeContext& node, interfaces::BlockAndHeaderTipInfo* tip_info)
|
|||
// This is defined and set here instead of inline in validation.h to avoid a hard
|
||||
// dependency between validation and index/base, since the latter is not in
|
||||
// libbitcoinkernel.
|
||||
chainman.restart_indexes = [&node]() {
|
||||
chainman.snapshot_download_completed = [&node]() {
|
||||
if (!node.chainman->m_blockman.IsPruneMode()) {
|
||||
LogPrintf("[snapshot] re-enabling NODE_NETWORK services\n");
|
||||
node.connman->AddLocalServices(NODE_NETWORK);
|
||||
}
|
||||
|
||||
LogPrintf("[snapshot] restarting indexes\n");
|
||||
|
||||
// Drain the validation interface queue to ensure that the old indexes
|
||||
|
|
@ -1871,8 +1876,13 @@ bool AppInitMain(NodeContext& node, interfaces::BlockAndHeaderTipInfo* tip_info)
|
|||
}
|
||||
}
|
||||
} else {
|
||||
LogPrintf("Setting NODE_NETWORK on non-prune mode\n");
|
||||
nLocalServices = ServiceFlags(nLocalServices | NODE_NETWORK);
|
||||
// Prior to setting NODE_NETWORK, check if we can provide historical blocks.
|
||||
if (!WITH_LOCK(chainman.GetMutex(), return chainman.BackgroundSyncInProgress())) {
|
||||
LogPrintf("Setting NODE_NETWORK on non-prune mode\n");
|
||||
nLocalServices = ServiceFlags(nLocalServices | NODE_NETWORK);
|
||||
} else {
|
||||
LogPrintf("Running node in NODE_NETWORK_LIMITED mode until snapshot background sync completes\n");
|
||||
}
|
||||
}
|
||||
|
||||
// ********************************************************* Step 11: import blocks
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue