mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-19 13:27:35 +02:00
init: Delay RPC block notif until warmup finished
See added code comment for more details.
This commit is contained in:
parent
8d466a8504
commit
2414ebc18b
2 changed files with 10 additions and 2 deletions
10
src/init.cpp
10
src/init.cpp
|
|
@ -1777,7 +1777,17 @@ bool AppInitMain(NodeContext& node, interfaces::BlockAndHeaderTipInfo* tip_info)
|
|||
|
||||
// ********************************************************* Step 13: finished
|
||||
|
||||
// At this point, the RPC is "started", but still in warmup, which means it
|
||||
// cannot yet be called. Before we make it callable, we need to make sure
|
||||
// that the RPC's view of the best block is valid and consistent with
|
||||
// ChainstateManager's ActiveTip.
|
||||
//
|
||||
// If we do not do this, RPC's view of the best block will be height=0 and
|
||||
// hash=0x0. This will lead to erroroneous responses for things like
|
||||
// waitforblockheight.
|
||||
RPCNotifyBlockChange(chainman.ActiveTip());
|
||||
SetRPCWarmupFinished();
|
||||
|
||||
uiInterface.InitMessage(_("Done loading").translated);
|
||||
|
||||
for (const auto& client : node.chain_clients) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue