Changeset View
Changeset View
Standalone View
Standalone View
src/test/util/setup_common.cpp
Show First 20 Lines • Show All 269 Lines • ▼ Show 20 Lines | std::sort(std::begin(block.vtx) + 1, std::end(block.vtx), | ||||
[](const std::shared_ptr<const CTransaction> &txa, | [](const std::shared_ptr<const CTransaction> &txa, | ||||
const std::shared_ptr<const CTransaction> &txb) -> bool { | const std::shared_ptr<const CTransaction> &txb) -> bool { | ||||
return txa->GetId() < txb->GetId(); | return txa->GetId() < txb->GetId(); | ||||
}); | }); | ||||
// IncrementExtraNonce creates a valid coinbase and merkleRoot | // IncrementExtraNonce creates a valid coinbase and merkleRoot | ||||
{ | { | ||||
LOCK(cs_main); | LOCK(cs_main); | ||||
unsigned int extraNonce = 0; | |||||
IncrementExtraNonce(&block, ::ChainActive().Tip(), | IncrementExtraNonce(&block, ::ChainActive().Tip(), | ||||
config.GetMaxBlockSize(), extraNonce); | config.GetMaxBlockSize()); | ||||
} | } | ||||
const Consensus::Params ¶ms = config.GetChainParams().GetConsensus(); | const Consensus::Params ¶ms = config.GetChainParams().GetConsensus(); | ||||
while (!CheckProofOfWork(block.GetHash(), block.nBits, params)) { | 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 = | ||||
▲ Show 20 Lines • Show All 125 Lines • Show Last 20 Lines |