mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-20 13:37:28 +02:00
Consensus: Refactor: Decouple pow.o from chainparams.o
This commit is contained in:
parent
bd006110fb
commit
d698ef690f
8 changed files with 42 additions and 35 deletions
|
|
@ -84,7 +84,7 @@ void UpdateTime(CBlockHeader* pblock, const CBlockIndex* pindexPrev)
|
|||
|
||||
// Updating time can change work required on testnet:
|
||||
if (Params().AllowMinDifficultyBlocks())
|
||||
pblock->nBits = GetNextWorkRequired(pindexPrev, pblock);
|
||||
pblock->nBits = GetNextWorkRequired(pindexPrev, pblock, Params().GetConsensus());
|
||||
}
|
||||
|
||||
CBlockTemplate* CreateNewBlock(const CScript& scriptPubKeyIn)
|
||||
|
|
@ -326,7 +326,7 @@ CBlockTemplate* CreateNewBlock(const CScript& scriptPubKeyIn)
|
|||
// Fill in header
|
||||
pblock->hashPrevBlock = pindexPrev->GetBlockHash();
|
||||
UpdateTime(pblock, pindexPrev);
|
||||
pblock->nBits = GetNextWorkRequired(pindexPrev, pblock);
|
||||
pblock->nBits = GetNextWorkRequired(pindexPrev, pblock, Params().GetConsensus());
|
||||
pblock->nNonce = 0;
|
||||
pblocktemplate->vTxSigOps[0] = GetLegacySigOpCount(pblock->vtx[0]);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue