mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-14 12:43:40 +02:00
Only schedule mainchain RPC checks after initial check succeeds
This commit is contained in:
parent
bb80fd1602
commit
9d4097dca2
1 changed files with 6 additions and 5 deletions
11
src/init.cpp
11
src/init.cpp
|
|
@ -1866,11 +1866,6 @@ bool AppInitMain()
|
|||
SetRPCWarmupFinished();
|
||||
|
||||
// ELEMENTS:
|
||||
CScheduler::Function f2 = boost::bind(&MainchainRPCCheck, false);
|
||||
unsigned int check_rpc_every = gArgs.GetArg("-recheckpeginblockinterval", 120);
|
||||
if (check_rpc_every) {
|
||||
scheduler.scheduleEvery(f2, check_rpc_every);
|
||||
}
|
||||
uiInterface.InitMessage(_("Awaiting mainchain RPC warmup"));
|
||||
if (!MainchainRPCCheck(true)) { //Initial check, fail immediately
|
||||
return InitError(_("ERROR: elementsd is set to verify pegins but cannot get valid response from the mainchain daemon. Please check debug.log for more information.")
|
||||
|
|
@ -1878,6 +1873,12 @@ bool AppInitMain()
|
|||
+ strprintf(_("If you haven't setup a %s please get the latest stable version from %s or if you do not need to validate pegins set in your elements configuration %s"), "bitcoind", "https://bitcoincore.org/en/download/", "validatepegin=0"));
|
||||
}
|
||||
|
||||
CScheduler::Function f2 = boost::bind(&MainchainRPCCheck, false);
|
||||
unsigned int check_rpc_every = gArgs.GetArg("-recheckpeginblockinterval", 120);
|
||||
if (check_rpc_every) {
|
||||
scheduler.scheduleEvery(f2, check_rpc_every);
|
||||
}
|
||||
|
||||
uiInterface.InitMessage(_("Done loading"));
|
||||
|
||||
g_wallet_init_interface.Start(scheduler);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue