Skip to content

Commit

Permalink
Move MainchainRPCCheck to its own schedule to avoid waiting for itsel…
Browse files Browse the repository at this point in the history
…f to finish
  • Loading branch information
instagibbs committed Jun 5, 2019
1 parent 1b78b9f commit 740a8b8
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
4 changes: 2 additions & 2 deletions contrib/gitian-descriptors/gitian-liquid-win.yml
Expand Up @@ -167,7 +167,8 @@ script: |
make deploy
make install DESTDIR=${INSTALLPATH}
rename 's/-setup\.exe$/-setup-unsigned.exe/' *-setup.exe
cp -f elements-*setup*.exe $OUTDIR/
rename 's/elements-/liquid-/s' *-setup-unsigned.exe
cp -f liquid-*setup*.exe $OUTDIR/
cd installed
mv ${DISTNAME}/bin/elements-qt.exe ${DISTNAME}/bin/liquid-qt.exe
Expand All @@ -186,7 +187,6 @@ script: |
mkdir unsigned
cp $OUTDIR/elements-*setup-unsigned.exe unsigned/
cd unsigned
rename 's/elements-/liquid-/s' *-setup-unsigned.exe
cd ..
find . | sort | tar --no-recursion --mode='u+rw,go+r-w,a+X' --owner=0 --group=0 -c -T - | gzip -9n > ${OUTDIR}/${DISTNAME}-win-unsigned.tar.gz
mv ${OUTDIR}/${DISTNAME}-x86_64-*-debug.zip ${OUTDIR}/${DISTNAME}-win64-debug.zip
Expand Down
9 changes: 7 additions & 2 deletions src/init.cpp
Expand Up @@ -179,6 +179,7 @@ static std::unique_ptr<ECCVerifyHandle> globalVerifyHandle;

static boost::thread_group threadGroup;
static CScheduler scheduler;
static CScheduler reverification_scheduler;

void Interrupt()
{
Expand Down Expand Up @@ -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"));
}

// 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);
unsigned int check_rpc_every = gArgs.GetArg("-recheckpeginblockinterval", 120);
unsigned int check_rpc_every = gArgs.GetArg("-recheckpeginblockinterval", 120) * 1000;
if (check_rpc_every) {
scheduler.scheduleEvery(f2, check_rpc_every);
reverification_scheduler.scheduleEvery(f2, check_rpc_every);
}

uiInterface.InitMessage(_("Done loading"));
Expand Down

0 comments on commit 740a8b8

Please sign in to comment.