mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-07-04 20:51:27 +02:00
CBlockIndex::GetBlockWork() + GetProofIncrement(nBits) -> GetBlockProof(CBlockIndex)
This commit is contained in:
@ -97,12 +97,12 @@ bool CheckProofOfWork(uint256 hash, unsigned int nBits)
|
||||
return true;
|
||||
}
|
||||
|
||||
uint256 GetProofIncrement(unsigned int nBits)
|
||||
uint256 GetBlockProof(const CBlockIndex& block)
|
||||
{
|
||||
uint256 bnTarget;
|
||||
bool fNegative;
|
||||
bool fOverflow;
|
||||
bnTarget.SetCompact(nBits, &fNegative, &fOverflow);
|
||||
bnTarget.SetCompact(block.nBits, &fNegative, &fOverflow);
|
||||
if (fNegative || fOverflow || bnTarget == 0)
|
||||
return 0;
|
||||
// We need to compute 2**256 / (bnTarget+1), but we can't represent 2**256
|
||||
|
Reference in New Issue
Block a user