Permalink
Browse files

Merge trivial_blockmaxsize_mainnet

  • Loading branch information...
luke-jr committed Mar 7, 2017
2 parents 9ba797f + 274e5fe commit bde01d519b55bc9bd77db704dd23875543b0078b
Showing with 7 additions and 0 deletions.
  1. +7 −0 src/miner.cpp
View
@@ -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

Please sign in to comment.