From c2c02f3fa99385f5a5be722fda6f71522c93bdaa Mon Sep 17 00:00:00 2001 From: jtimon Date: Sat, 28 Jun 2014 14:03:06 +0200 Subject: Move UpdateTime to pow --- src/main.h | 2 -- 1 file changed, 2 deletions(-) (limited to 'src/main.h') diff --git a/src/main.h b/src/main.h index 886cac1507..adb7d68bcf 100644 --- a/src/main.h +++ b/src/main.h @@ -163,8 +163,6 @@ bool GetTransaction(const uint256 &hash, CTransaction &tx, uint256 &hashBlock, b bool ActivateBestChain(CValidationState &state); int64_t GetBlockValue(int nHeight, int64_t nFees); -void UpdateTime(CBlockHeader& block, const CBlockIndex* pindexPrev); - /** Create a new block index entry for a given block hash */ CBlockIndex * InsertBlockIndex(uint256 hash); /** Verify a signature */ -- cgit v1.2.3 From b343c1a1e34f851e70649ad1f49855a7d878f9ef Mon Sep 17 00:00:00 2001 From: jtimon Date: Sat, 5 Jul 2014 12:05:33 +0200 Subject: Move CBlockIndex::GetBlockWork() to pow::GetProofIncrement(nBits) --- src/main.h | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) (limited to 'src/main.h') diff --git a/src/main.h b/src/main.h index adb7d68bcf..a15a0e16d0 100644 --- a/src/main.h +++ b/src/main.h @@ -14,6 +14,7 @@ #include "coins.h" #include "core.h" #include "net.h" +#include "pow.h" #include "script.h" #include "sync.h" #include "txmempool.h" @@ -792,17 +793,7 @@ public: uint256 GetBlockWork() const { - uint256 bnTarget; - bool fNegative; - bool fOverflow; - bnTarget.SetCompact(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 - // as it's too large for a 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. - return (~bnTarget / (bnTarget + 1)) + 1; + return GetProofIncrement(nBits); } enum { nMedianTimeSpan=11 }; -- cgit v1.2.3