mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-16 13:01:19 +02:00
Move MainchainRPCCheck to its own schedule, fix resolution
This commit is contained in:
parent
1b78b9f222
commit
a502bc8ff9
1 changed files with 7 additions and 2 deletions
|
|
@ -179,6 +179,7 @@ static std::unique_ptr<ECCVerifyHandle> globalVerifyHandle;
|
||||||
|
|
||||||
static boost::thread_group threadGroup;
|
static boost::thread_group threadGroup;
|
||||||
static CScheduler scheduler;
|
static CScheduler scheduler;
|
||||||
|
static CScheduler reverification_scheduler;
|
||||||
|
|
||||||
void Interrupt()
|
void Interrupt()
|
||||||
{
|
{
|
||||||
|
|
@ -1960,10 +1961,14 @@ bool AppInitMain(InitInterfaces& interfaces)
|
||||||
+ 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"));
|
+ 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"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Start the lightweight block re-evaluation scheduler thread
|
||||||
|
CScheduler::Function reevaluationLoop = std::bind(&CScheduler::serviceQueue, &reverification_scheduler);
|
||||||
|
threadGroup.create_thread(std::bind(&TraceThread<CScheduler::Function>, "reevaluation_scheduler", reevaluationLoop));
|
||||||
|
|
||||||
CScheduler::Function f2 = boost::bind(&MainchainRPCCheck, false);
|
CScheduler::Function f2 = boost::bind(&MainchainRPCCheck, false);
|
||||||
unsigned int check_rpc_every = gArgs.GetArg("-recheckpeginblockinterval", 120);
|
unsigned int check_rpc_every = gArgs.GetArg("-recheckpeginblockinterval", 120) * 1000;
|
||||||
if (check_rpc_every) {
|
if (check_rpc_every) {
|
||||||
scheduler.scheduleEvery(f2, check_rpc_every);
|
reverification_scheduler.scheduleEvery(f2, check_rpc_every);
|
||||||
}
|
}
|
||||||
|
|
||||||
uiInterface.InitMessage(_("Done loading"));
|
uiInterface.InitMessage(_("Done loading"));
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue