Skip to content

Commit

Permalink
Merge pull request miketout#302 from VerusCoin/dev
Browse files Browse the repository at this point in the history
0.7.1-5
  • Loading branch information
Asherda authored Aug 3, 2020
2 parents 1d7c275 + 3416b40 commit 8e50ee2
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 18 deletions.
4 changes: 2 additions & 2 deletions src/pbaas/pbaas.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1874,8 +1874,8 @@ void CConnectedChains::SignAndCommitImportTransactions(const CTransaction &lastI
}
else
{
fprintf(stderr,"%s: rejected by memory pool for\n", __func__);
LogPrintf("%s: rejected by memory pool for\n", __func__);
fprintf(stderr,"%s: rejected by memory pool for %s\n", __func__, state.GetRejectReason().c_str());
LogPrintf("%s: rejected by memory pool for %s\n", __func__, state.GetRejectReason().c_str());
}
}
break;
Expand Down
27 changes: 11 additions & 16 deletions src/rpc/mining.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -463,23 +463,18 @@ UniValue getmininginfo(const UniValue& params, bool fHelp)
{
bnStakeTarget.SetCompact(lwmaGetNextPOSRequired(&index, consensus));

if (bnStakeTarget == 0)
if (bnStakeTarget != 0)
{
totalChainStake = 0;
avgBlockFees = false;
LogPrintf("%s: failed to estimate staking supply\n", __func__);
break;
}

// We need to compute 2**256 / (bnTarget+1), but we can't represent 2**256
// as it's too large for a arith_uint256. However, as 2**256 is at least as large
// as bnTarget+1, it is equal to ((2**256 - bnTarget - 1) / (bnTarget+1)) + 1,
// or ~bnTarget / (nTarget+1) + 1.
totalChainStake = totalChainStake + (~bnStakeTarget / (bnStakeTarget + 1)) + 1;
blockCount++;
if (index.IsVerusPOSBlock())
{
posCount++;
// We need to compute 2**256 / (bnTarget+1), but we can't represent 2**256
// as it's too large for a arith_uint256. However, as 2**256 is at least as large
// as bnTarget+1, it is equal to ((2**256 - bnTarget - 1) / (bnTarget+1)) + 1,
// or ~bnTarget / (nTarget+1) + 1.
totalChainStake = totalChainStake + (~bnStakeTarget / (bnStakeTarget + 1)) + 1;
blockCount++;
if (index.IsVerusPOSBlock())
{
posCount++;
}
}
}
}
Expand Down

0 comments on commit 8e50ee2

Please sign in to comment.