From ced3ba591dd75535e6d614eea913d01d02bd0f94 Mon Sep 17 00:00:00 2001 From: Duke Leto Date: Thu, 19 Aug 2021 19:09:05 -0400 Subject: [PATCH] Fix coredump when running hush-cli during RPC warmup --- src/rpc/blockchain.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/rpc/blockchain.cpp b/src/rpc/blockchain.cpp index 609f26420..f6a1f6dde 100644 --- a/src/rpc/blockchain.cpp +++ b/src/rpc/blockchain.cpp @@ -1567,7 +1567,6 @@ inline CBlockIndex* LookupBlockIndex(const uint256& hash) UniValue getchaintxstats(const UniValue& params, bool fHelp, const CPubKey& mypk) { - THROW_IF_SYNCING(HUSH_INSYNC); if (fHelp || params.size() > 2) throw runtime_error( @@ -1631,6 +1630,8 @@ UniValue getchaintxstats(const UniValue& params, bool fHelp, const CPubKey& mypk + HelpExampleRpc("getchaintxstats", "2016") ); + THROW_IF_SYNCING(HUSH_INSYNC); + const CBlockIndex* pindex; int blockcount = 30 * 24 * 60 * 60 / Params().GetConsensus().nPowTargetSpacing; // By default: 1 month