Skip to content

Commit fb0224a

Browse files
committed
Merge 94c7644 into merged_master (Elements PR ElementsProject#647)
2 parents a8c2ff2 + 94c7644 commit fb0224a

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/init.cpp

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,7 @@ static std::unique_ptr<ECCVerifyHandle> globalVerifyHandle;
184184

185185
static boost::thread_group threadGroup;
186186
static CScheduler scheduler;
187+
static CScheduler reverification_scheduler;
187188

188189
void Interrupt()
189190
{
@@ -1987,10 +1988,14 @@ bool AppInitMain(InitInterfaces& interfaces)
19871988
+ 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"));
19881989
}
19891990

1991+
// Start the lightweight block re-evaluation scheduler thread
1992+
CScheduler::Function reevaluationLoop = std::bind(&CScheduler::serviceQueue, &reverification_scheduler);
1993+
threadGroup.create_thread(std::bind(&TraceThread<CScheduler::Function>, "reevaluation_scheduler", reevaluationLoop));
1994+
19901995
CScheduler::Function f2 = boost::bind(&MainchainRPCCheck, false);
1991-
unsigned int check_rpc_every = gArgs.GetArg("-recheckpeginblockinterval", 120);
1996+
unsigned int check_rpc_every = gArgs.GetArg("-recheckpeginblockinterval", 120) * 1000;
19921997
if (check_rpc_every) {
1993-
scheduler.scheduleEvery(f2, check_rpc_every);
1998+
reverification_scheduler.scheduleEvery(f2, check_rpc_every);
19941999
}
19952000

19962001
uiInterface.InitMessage(_("Done loading"));

0 commit comments

Comments
 (0)