This commit is contained in:
jl777
2018-09-21 20:29:18 -11:00
parent 9a59ff3ff1
commit 2dd23a2617

View File

@@ -1410,16 +1410,18 @@ UniValue getchaintips(const UniValue& params, bool fHelp)
+ HelpExampleRpc("getchaintips", "")
);
if ( mapBlockIndex == 0 )
throw runtime_error("mapBlockIndex is NULL\n");
LOCK(cs_main);
/* Build up a list of chain tips. We start with the list of all
known blocks, and successively remove blocks that appear as pprev
of another block. */
std::set<const CBlockIndex*, CompareBlocksByHeight> setTips;
BOOST_FOREACH(const PAIRTYPE(const uint256, CBlockIndex*)& item, mapBlockIndex)
{
if ( item != 0 )
setTips.insert(item.second);
setTips.insert(item.second);
}
BOOST_FOREACH(const PAIRTYPE(const uint256, CBlockIndex*)& item, mapBlockIndex)
{