Test
This commit is contained in:
@@ -1410,16 +1410,18 @@ UniValue getchaintips(const UniValue& params, bool fHelp)
|
|||||||
+ HelpExampleRpc("getchaintips", "")
|
+ HelpExampleRpc("getchaintips", "")
|
||||||
);
|
);
|
||||||
|
|
||||||
|
if ( mapBlockIndex == 0 )
|
||||||
|
throw runtime_error("mapBlockIndex is NULL\n");
|
||||||
LOCK(cs_main);
|
LOCK(cs_main);
|
||||||
|
|
||||||
/* Build up a list of chain tips. We start with the list of all
|
/* Build up a list of chain tips. We start with the list of all
|
||||||
known blocks, and successively remove blocks that appear as pprev
|
known blocks, and successively remove blocks that appear as pprev
|
||||||
of another block. */
|
of another block. */
|
||||||
|
|
||||||
std::set<const CBlockIndex*, CompareBlocksByHeight> setTips;
|
std::set<const CBlockIndex*, CompareBlocksByHeight> setTips;
|
||||||
BOOST_FOREACH(const PAIRTYPE(const uint256, CBlockIndex*)& item, mapBlockIndex)
|
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)
|
BOOST_FOREACH(const PAIRTYPE(const uint256, CBlockIndex*)& item, mapBlockIndex)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user