mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-14 12:43:40 +02:00
Testchains: Don't check the genesis block
Rebased by Pieter Wuille. Cleanup by Matt Corallo.
This commit is contained in:
parent
20a84b8c45
commit
6bb56092b8
3 changed files with 5 additions and 1 deletions
|
|
@ -80,6 +80,9 @@ bool CheckProofOfWork(uint256 hash, unsigned int nBits, const Consensus::Params&
|
|||
bool fOverflow;
|
||||
arith_uint256 bnTarget;
|
||||
|
||||
if (hash == params.hashGenesisBlock)
|
||||
return true;
|
||||
|
||||
bnTarget.SetCompact(nBits, &fNegative, &fOverflow);
|
||||
|
||||
// Check range
|
||||
|
|
|
|||
|
|
@ -199,7 +199,7 @@ bool CBlockTreeDB::LoadBlockIndexGuts(boost::function<CBlockIndex*(const uint256
|
|||
pindexNew->nStatus = diskindex.nStatus;
|
||||
pindexNew->nTx = diskindex.nTx;
|
||||
|
||||
if (!CheckProofOfWork(pindexNew->GetBlockHash(), pindexNew->nBits, Params().GetConsensus()))
|
||||
if (!CheckProofOfWork(pindexNew->GetBlockHash(), pindexNew->nBits, consensusParams))
|
||||
return error("LoadBlockIndex(): CheckProofOfWork failed: %s", pindexNew->ToString());
|
||||
|
||||
pcursor->Next();
|
||||
|
|
|
|||
|
|
@ -20,6 +20,7 @@
|
|||
class CBlockIndex;
|
||||
class CCoinsViewDBCursor;
|
||||
class uint256;
|
||||
namespace Consensus { struct Params; }
|
||||
|
||||
//! -dbcache default (MiB)
|
||||
static const int64_t nDefaultDbCache = 300;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue