Permalink
Browse files
Merge trivial_blockmaxsize_mainnet
- Loading branch information...
Showing
with
7 additions
and
0 deletions.
-
+7
−0
src/miner.cpp
|
|
@@ -146,6 +146,13 @@ std::unique_ptr<CBlockTemplate> BlockAssembler::CreateNewBlock(const CScript& sc |
|
|
CBlockIndex* pindexPrev = chainActive.Tip();
|
|
|
nHeight = pindexPrev->nHeight + 1;
|
|
|
|
|
|
+ if (fNeedSizeAccounting && !IsWitnessEnabled(pindexPrev, chainparams.GetConsensus())) {
|
|
|
+ // Just translate to nBlockMaxWeight
|
|
|
+ nBlockMaxWeight = std::min(nBlockMaxSize * WITNESS_SCALE_FACTOR, nBlockMaxWeight);
|
|
|
+ nBlockMaxSize = MAX_BLOCK_SERIALIZED_SIZE-1000;
|
|
|
+ fNeedSizeAccounting = false;
|
|
|
+ }
|
|
|
+
|
|
|
pblock->nVersion = ComputeBlockVersion(pindexPrev, chainparams.GetConsensus());
|
|
|
// -regtest only: allow overriding block.nVersion with
|
|
|
// -blockversion=N to test forking scenarios
|
|
|
|
0 comments on commit
bde01d5