Skip to content

Commit 740a8b8

Browse files
committed
Move MainchainRPCCheck to its own schedule to avoid waiting for itself to finish
1 parent 1b78b9f commit 740a8b8

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

contrib/gitian-descriptors/gitian-liquid-win.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,8 @@ script: |
167167
make deploy
168168
make install DESTDIR=${INSTALLPATH}
169169
rename 's/-setup\.exe$/-setup-unsigned.exe/' *-setup.exe
170-
cp -f elements-*setup*.exe $OUTDIR/
170+
rename 's/elements-/liquid-/s' *-setup-unsigned.exe
171+
cp -f liquid-*setup*.exe $OUTDIR/
171172
cd installed
172173
173174
mv ${DISTNAME}/bin/elements-qt.exe ${DISTNAME}/bin/liquid-qt.exe
@@ -186,7 +187,6 @@ script: |
186187
mkdir unsigned
187188
cp $OUTDIR/elements-*setup-unsigned.exe unsigned/
188189
cd unsigned
189-
rename 's/elements-/liquid-/s' *-setup-unsigned.exe
190190
cd ..
191191
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
192192
mv ${OUTDIR}/${DISTNAME}-x86_64-*-debug.zip ${OUTDIR}/${DISTNAME}-win64-debug.zip

src/init.cpp

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

180180
static boost::thread_group threadGroup;
181181
static CScheduler scheduler;
182+
static CScheduler reverification_scheduler;
182183

183184
void Interrupt()
184185
{
@@ -1960,10 +1961,14 @@ bool AppInitMain(InitInterfaces& interfaces)
19601961
+ 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"));
19611962
}
19621963

1964+
// Start the lightweight block re-evaluation scheduler thread
1965+
CScheduler::Function reevaluationLoop = std::bind(&CScheduler::serviceQueue, &reverification_scheduler);
1966+
threadGroup.create_thread(std::bind(&TraceThread<CScheduler::Function>, "reevaluation_scheduler", reevaluationLoop));
1967+
19631968
CScheduler::Function f2 = boost::bind(&MainchainRPCCheck, false);
1964-
unsigned int check_rpc_every = gArgs.GetArg("-recheckpeginblockinterval", 120);
1969+
unsigned int check_rpc_every = gArgs.GetArg("-recheckpeginblockinterval", 120) * 1000;
19651970
if (check_rpc_every) {
1966-
scheduler.scheduleEvery(f2, check_rpc_every);
1971+
reverification_scheduler.scheduleEvery(f2, check_rpc_every);
19671972
}
19681973

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

0 commit comments

Comments
 (0)