diff options
| author | Wladimir J. van der Laan <[email protected]> | 2014-10-17 12:24:29 +0200 |
|---|---|---|
| committer | Wladimir J. van der Laan <[email protected]> | 2014-10-17 12:30:54 +0200 |
| commit | 84d13eef883769451ba9f77b56d9738d24474d5c (patch) | |
| tree | cc161844cd5cd599a3eac8787dffb11c16118cc4 /src/pow.cpp | |
| parent | doc: Add historical release notes for 0.9.3 (diff) | |
| parent | Fix large reorgs (diff) | |
| download | discoin-84d13eef883769451ba9f77b56d9738d24474d5c.tar.xz discoin-84d13eef883769451ba9f77b56d9738d24474d5c.zip | |
Merge pull request #4468
e11b2ce Fix large reorgs (Pieter Wuille)
afc32c5 Fix rebuild-chainstate feature and improve its performance (Pieter Wuille)
16d5194 Skip reindexed blocks individually (Pieter Wuille)
ad96e7c Make -reindex cope with out-of-order blocks (Wladimir J. van der Laan)
e17bd58 Rename setBlockIndexValid to setBlockIndexCandidates (Pieter Wuille)
1af838b Add height to "Requesting block" debug (R E Broadley)
1bcee67 Better logging of stalling (R E Broadley)
4c93322 Improve getheaders (sending) logging (R E Broadley)
f244c99 Remove CheckMinWork, as we always know all parent headers (Pieter Wuille)
ad6e601 RPC additions after headers-first (Pieter Wuille)
341735e Headers-first synchronization (Pieter Wuille)
Diffstat (limited to 'src/pow.cpp')
| -rw-r--r-- | src/pow.cpp | 33 |
1 files changed, 0 insertions, 33 deletions
diff --git a/src/pow.cpp b/src/pow.cpp index d50222849..75fbfc6a6 100644 --- a/src/pow.cpp +++ b/src/pow.cpp @@ -98,39 +98,6 @@ bool CheckProofOfWork(uint256 hash, unsigned int nBits) return true; } -// -// true if nBits is greater than the minimum amount of work that could -// possibly be required deltaTime after minimum work required was nBase -// -bool CheckMinWork(unsigned int nBits, unsigned int nBase, int64_t deltaTime) -{ - bool fOverflow = false; - uint256 bnNewBlock; - bnNewBlock.SetCompact(nBits, NULL, &fOverflow); - if (fOverflow) - return false; - - const uint256 &bnLimit = Params().ProofOfWorkLimit(); - // Testnet has min-difficulty blocks - // after Params().TargetSpacing()*2 time between blocks: - if (Params().AllowMinDifficultyBlocks() && deltaTime > Params().TargetSpacing()*2) - return bnNewBlock <= bnLimit; - - uint256 bnResult; - bnResult.SetCompact(nBase); - while (deltaTime > 0 && bnResult < bnLimit) - { - // Maximum 400% adjustment... - bnResult *= 4; - // ... in best-case exactly 4-times-normal target time - deltaTime -= Params().TargetTimespan()*4; - } - if (bnResult > bnLimit) - bnResult = bnLimit; - - return bnNewBlock <= bnResult; -} - void UpdateTime(CBlockHeader* pblock, const CBlockIndex* pindexPrev) { pblock->nTime = std::max(pindexPrev->GetMedianTimePast()+1, GetAdjustedTime()); |