Changeset View
Changeset View
Standalone View
Standalone View
src/test/test_bitcoin.cpp
Show First 20 Lines • Show All 183 Lines • ▼ Show 20 Lines | CBlock TestChain100Setup::CreateAndProcessBlock( | ||||
// IncrementExtraNonce creates a valid coinbase and merkleRoot | // IncrementExtraNonce creates a valid coinbase and merkleRoot | ||||
{ | { | ||||
LOCK(cs_main); | LOCK(cs_main); | ||||
unsigned int extraNonce = 0; | unsigned int extraNonce = 0; | ||||
IncrementExtraNonce(config, &block, chainActive.Tip(), extraNonce); | IncrementExtraNonce(config, &block, chainActive.Tip(), extraNonce); | ||||
} | } | ||||
while (!CheckProofOfWork(block.GetHash(), block.nBits, config)) { | const Consensus::Params ¶ms = config.GetChainParams().GetConsensus(); | ||||
while (!CheckProofOfWork(block.GetHash(), block.nBits, params)) { | |||||
++block.nNonce; | ++block.nNonce; | ||||
} | } | ||||
std::shared_ptr<const CBlock> shared_pblock = | std::shared_ptr<const CBlock> shared_pblock = | ||||
std::make_shared<const CBlock>(block); | std::make_shared<const CBlock>(block); | ||||
ProcessNewBlock(config, shared_pblock, true, nullptr); | ProcessNewBlock(config, shared_pblock, true, nullptr); | ||||
CBlock result = block; | CBlock result = block; | ||||
Show All 20 Lines |