diff options
| author | Pieter Wuille <[email protected]> | 2014-09-06 21:16:25 +0200 |
|---|---|---|
| committer | Pieter Wuille <[email protected]> | 2014-10-14 15:42:01 -0700 |
| commit | f244c99c96636136678f17e7ef3952a864613ad0 (patch) | |
| tree | 46fe2c8f9c9b9f5d16e8b9804e9c3c1d3b4a6e45 /src/main.cpp | |
| parent | RPC additions after headers-first (diff) | |
| download | discoin-f244c99c96636136678f17e7ef3952a864613ad0.tar.xz discoin-f244c99c96636136678f17e7ef3952a864613ad0.zip | |
Remove CheckMinWork, as we always know all parent headers
Diffstat (limited to 'src/main.cpp')
| -rw-r--r-- | src/main.cpp | 17 |
1 files changed, 0 insertions, 17 deletions
diff --git a/src/main.cpp b/src/main.cpp index 604ca670e..dba4292f5 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -2329,23 +2329,6 @@ bool AcceptBlockHeader(const CBlockHeader& block, CValidationState& state, CBloc return true; } - CBlockIndex* pcheckpoint = Checkpoints::GetLastCheckpoint(); - if (pcheckpoint && block.hashPrevBlock != (chainActive.Tip() ? chainActive.Tip()->GetBlockHash() : uint256(0))) - { - // Extra checks to prevent "fill up memory by spamming with bogus blocks" - int64_t deltaTime = block.GetBlockTime() - pcheckpoint->GetBlockTime(); - if (deltaTime < 0) - { - return state.DoS(100, error("%s : block with timestamp before last checkpoint", __func__), - REJECT_CHECKPOINT, "time-too-old"); - } - if (!CheckMinWork(block.nBits, pcheckpoint->nBits, deltaTime)) - { - return state.DoS(100, error("%s : block with too little proof-of-work", __func__), - REJECT_INVALID, "bad-diffbits"); - } - } - // Get prev block index CBlockIndex* pindexPrev = NULL; int nHeight = 0; |