Changeset View
Changeset View
Standalone View
Standalone View
src/test/test_bitcoin.cpp
Show First 20 Lines • Show All 181 Lines • ▼ Show 20 Lines | std::sort(std::begin(block.vtx) + 1, std::end(block.vtx), | ||||
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; | unsigned int extraNonce = 0; | ||||
IncrementExtraNonce(&block, chainActive.Tip(), config.GetMaxBlockSize(), | IncrementExtraNonce(&block, ::ChainActive().Tip(), | ||||
extraNonce); | config.GetMaxBlockSize(), extraNonce); | ||||
} | } | ||||
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 124 Lines • Show Last 20 Lines |