From 02fefe07344f4b0572e4f59629aafaa2deb64713 Mon Sep 17 00:00:00 2001 From: Duke Leto Date: Sat, 21 Dec 2019 10:28:48 -0500 Subject: [PATCH] Add -hardfork-height CLI option to simulate different hardfork heights --- src/komodo_bitcoind.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/komodo_bitcoind.h b/src/komodo_bitcoind.h index e79548f3b..316172250 100644 --- a/src/komodo_bitcoind.h +++ b/src/komodo_bitcoind.h @@ -705,7 +705,11 @@ extern const uint32_t nHushHardforkHeight; bool hush_hardfork_active(uint32_t time) { - return (chainActive.Height() > nHushHardforkHeight); + //This allows simulating a different height via CLI option, with hardcoded height as default + uint32_t nHardForkHeight = GetArg("-hardfork-height", nHushHardforkHeight); + bool isactive = chainActive.Height() > nHardforkHeight; + fprintf(stderr, "%s: active=%d at height=%d and forkheigt=%d\n", __FUNCTION__, (int)isactive, chainActive.Height(), nHardForkHeight); + return isactive; } bool MarmaraPoScheck(char *destaddr,CScript opret,CTransaction staketx);