mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-16 13:01:19 +02:00
CreateNewBlock: Only do signed block stuff when active
This commit is contained in:
parent
f26b992d8a
commit
18a804c09c
1 changed files with 8 additions and 7 deletions
|
|
@ -143,13 +143,14 @@ std::unique_ptr<CBlockTemplate> BlockAssembler::CreateNewBlock(const CScript& sc
|
|||
// transaction (which in most cases can be a no-op).
|
||||
fIncludeWitness = IsWitnessEnabled(pindexPrev, chainparams.GetConsensus()) && fMineWitnessTx;
|
||||
|
||||
// Pad block weight by block proof fields (including upper-bound of signature)
|
||||
nBlockWeight += chainparams.GetConsensus().signblockscript.size() * WITNESS_SCALE_FACTOR;
|
||||
nBlockWeight += chainparams.GetConsensus().max_block_signature_size * WITNESS_SCALE_FACTOR;
|
||||
|
||||
// Reset block proof
|
||||
ResetProof(*pblock);
|
||||
ResetChallenge(*pblock, *pindexPrev, chainparams.GetConsensus());
|
||||
if (g_signed_blocks) {
|
||||
// Pad block weight by block proof fields (including upper-bound of signature)
|
||||
nBlockWeight += chainparams.GetConsensus().signblockscript.size() * WITNESS_SCALE_FACTOR;
|
||||
nBlockWeight += chainparams.GetConsensus().max_block_signature_size * WITNESS_SCALE_FACTOR;
|
||||
// Reset block proof
|
||||
ResetProof(*pblock);
|
||||
ResetChallenge(*pblock, *pindexPrev, chainparams.GetConsensus());
|
||||
}
|
||||
|
||||
int nPackagesSelected = 0;
|
||||
int nDescendantsUpdated = 0;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue