This commit is contained in:
jl777
2018-09-21 20:48:11 -11:00
parent 7108bc79f5
commit 5aad163700
2 changed files with 34 additions and 33 deletions

View File

@@ -1378,8 +1378,6 @@ void komodo_passport_iteration()
fprintf(stderr,"[%s] PASSPORT iteration waiting for KOMODO_INITDONE\n",ASSETCHAINS_SYMBOL); fprintf(stderr,"[%s] PASSPORT iteration waiting for KOMODO_INITDONE\n",ASSETCHAINS_SYMBOL);
sleep(3); sleep(3);
} }
KOMODO_PASSPORT_INITDONE = 1;
return;
if ( komodo_chainactive_timestamp() > lastinterest ) if ( komodo_chainactive_timestamp() > lastinterest )
{ {
komodo_interestsum(); komodo_interestsum();

View File

@@ -1410,8 +1410,6 @@ UniValue getchaintips(const UniValue& params, bool fHelp)
+ HelpExampleRpc("getchaintips", "") + HelpExampleRpc("getchaintips", "")
); );
UniValue res(UniValue::VARR);
{
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
@@ -1422,22 +1420,27 @@ UniValue getchaintips(const UniValue& params, bool fHelp)
int32_t n = 0; int32_t n = 0;
BOOST_FOREACH(const PAIRTYPE(const uint256, CBlockIndex*)& item, mapBlockIndex) BOOST_FOREACH(const PAIRTYPE(const uint256, CBlockIndex*)& item, mapBlockIndex)
{ {
fprintf(stderr,"iterator %d\n",n++); n++;
setTips.insert(item.second); setTips.insert(item.second);
} }
fprintf(stderr,"iterations getchaintips %d\n",n);
n = 0;
BOOST_FOREACH(const PAIRTYPE(const uint256, CBlockIndex*)& item, mapBlockIndex) BOOST_FOREACH(const PAIRTYPE(const uint256, CBlockIndex*)& item, mapBlockIndex)
{ {
const CBlockIndex* pprev=0; const CBlockIndex* pprev=0;
n++;
if ( item.second != 0 ) if ( item.second != 0 )
pprev = item.second->pprev; pprev = item.second->pprev;
if (pprev) if (pprev)
setTips.erase(pprev); setTips.erase(pprev);
} }
fprintf(stderr,"iterations getchaintips %d\n",n);
// Always report the currently active tip. // Always report the currently active tip.
setTips.insert(chainActive.LastTip()); setTips.insert(chainActive.LastTip());
/* Construct the output array. */ /* Construct the output array. */
const CBlockIndex *forked; UniValue res(UniValue::VARR); const CBlockIndex *forked;
BOOST_FOREACH(const CBlockIndex* block, setTips) BOOST_FOREACH(const CBlockIndex* block, setTips)
BOOST_FOREACH(const CBlockIndex* block, setTips) BOOST_FOREACH(const CBlockIndex* block, setTips)
{ {
@@ -1474,7 +1477,7 @@ UniValue getchaintips(const UniValue& params, bool fHelp)
} }
res.push_back(obj); res.push_back(obj);
} }
}
return res; return res;
} }