From 4aa9ec468fc3bba22339e52d6cd3a7477b59b858 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 11 Sep 2018 07:13:22 -1100 Subject: [PATCH] Test --- src/rpcblockchain.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/rpcblockchain.cpp b/src/rpcblockchain.cpp index aac0c0f21..a799a5efc 100644 --- a/src/rpcblockchain.cpp +++ b/src/rpcblockchain.cpp @@ -107,6 +107,11 @@ static UniValue ValuePoolDesc( UniValue blockheaderToJSON(const CBlockIndex* blockindex) { UniValue result(UniValue::VOBJ); + if ( blockindex == 0 ) + { + result.push_back(Pair("error", "null blockhash")); + return(result); + } result.push_back(Pair("hash", blockindex->GetBlockHash().GetHex())); int confirmations = -1; // Only report confirmations if the block is on the main chain