File tree Expand file tree Collapse file tree 1 file changed +2
-3
lines changed
Expand file tree Collapse file tree 1 file changed +2
-3
lines changed Original file line number Diff line number Diff line change @@ -77,9 +77,8 @@ void RegenerateCommitments(CBlock& block, ChainstateManager& chainman)
7777
7878static BlockAssembler::Options ClampOptions (BlockAssembler::Options options)
7979{
80- Assert (options.block_reserved_weight <= MAX_BLOCK_WEIGHT);
81- Assert (options.block_reserved_weight >= MINIMUM_BLOCK_RESERVED_WEIGHT);
82- Assert (options.coinbase_output_max_additional_sigops <= MAX_BLOCK_SIGOPS_COST);
80+ options.block_reserved_weight = std::clamp<size_t >(options.block_reserved_weight , MINIMUM_BLOCK_RESERVED_WEIGHT, MAX_BLOCK_WEIGHT);
81+ options.coinbase_output_max_additional_sigops = std::clamp<size_t >(options.coinbase_output_max_additional_sigops , 0 , MAX_BLOCK_SIGOPS_COST);
8382 // Limit weight to between block_reserved_weight and MAX_BLOCK_WEIGHT for sanity:
8483 // block_reserved_weight can safely exceed -blockmaxweight, but the rest of the block template will be empty.
8584 options.nBlockMaxWeight = std::clamp<size_t >(options.nBlockMaxWeight , options.block_reserved_weight , MAX_BLOCK_WEIGHT);
You can’t perform that action at this time.
0 commit comments