Playin' dat Long Game with dat Longest Chain

This commit is contained in:
Duke Leto
2020-12-06 15:47:04 -05:00
parent 1f636f4d39
commit aae0336733
10 changed files with 20 additions and 20 deletions

View File

@@ -1651,7 +1651,7 @@ UniValue getblockchaininfo(const UniValue& params, bool fHelp, const CPubKey& my
if ( SMART_CHAIN_SYMBOL[0] == 0 ) {
progress = Checkpoints::GuessVerificationProgress(Params().Checkpoints(), chainActive.LastTip());
} else {
int32_t longestchain = HUSH_LONGESTCHAIN;//komodo_longestchain();
int32_t longestchain = HUSH_LONGESTCHAIN;//hush_longestchain();
progress = (longestchain > 0 ) ? (double) chainActive.Height() / longestchain : 1.0;
}
notarized_height = komodo_notarized_height(&prevMoMheight,&notarized_hash,&notarized_desttxid);

View File

@@ -55,7 +55,7 @@ using namespace std;
**/
uint64_t komodo_interestsum();
int32_t komodo_longestchain();
int32_t hush_longestchain();
int32_t komodo_notarized_height(int32_t *prevMoMheightp,uint256 *hashp,uint256 *txidp);
bool komodo_txnotarizedconfirmed(uint256 txid);
uint32_t komodo_chainactive_timestamp();

View File

@@ -178,7 +178,7 @@ UniValue getpeerinfo(const UniValue& params, bool fHelp, const CPubKey& mypk)
}
int32_t HUSH_LONGESTCHAIN;
int32_t komodo_longestchain()
int32_t hush_longestchain()
{
static int32_t depth;
int32_t ht,n=0,num=0,maxheight=0,height = 0;
@@ -194,7 +194,7 @@ int32_t komodo_longestchain()
}
BOOST_FOREACH(const CNodeStats& stats, vstats)
{
//fprintf(stderr,"komodo_longestchain iter.%d\n",n);
//fprintf(stderr,"hush_longestchain iter.%d\n",n);
CNodeStateStats statestats;
bool fStateStats = GetNodeStateStats(stats.nodeid,statestats);
if ( statestats.nSyncHeight < 0 )