From 8b9311e63779dd0c3861215076403a06d9d2d204 Mon Sep 17 00:00:00 2001 From: "Jonathan \"Duke\" Leto" Date: Thu, 28 Mar 2019 03:13:28 +0100 Subject: [PATCH] Add -stopat CLI arg so we can pause a full node and call getsnapshot/gettxoutsetinfo at a certain block height --- src/main.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index edcf2c928..c1439d894 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -213,7 +213,7 @@ namespace { } // anon namespace char ASSETCHAINS_SYMBOL[65] = { "HUSH" }; -uint32_t HUSH_STOPAT = GetArg("-stopat",0); +uint32_t HUSH_STOPAT = 0; #include "komodo_validation011.h" ////////////////////////////////////////////////////////////////////////////// @@ -2216,8 +2216,10 @@ bool ConnectBlock(const CBlock& block, CValidationState& state, CBlockIndex* pin { const CChainParams& chainparams = Params(); AssertLockHeld(cs_main); - - if ( HUSH_STOPAT != 0 && pindex->nHeight > HUSH_STOPAT ) { + HUSH_STOPAT = GetArg("-stopat",0); + if (HUSH_STOPAT) + printf("Going to stopat=%d\n", HUSH_STOPAT); + if (HUSH_STOPAT != 0 && pindex->nHeight > HUSH_STOPAT) { printf("Stopping at block height %d\n", HUSH_STOPAT); return(false); }