Fix coredump when running hush-cli during RPC warmup

This commit is contained in:
Duke Leto
2021-08-19 19:09:05 -04:00
parent 40715561a1
commit ced3ba591d

View File

@@ -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