File tree Expand file tree Collapse file tree 2 files changed +14
-0
lines changed
Expand file tree Collapse file tree 2 files changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -1016,6 +1016,13 @@ bool AppInitParameterInteraction(const ArgsManager& args)
10161016 }
10171017 }
10181018
1019+ if (args.IsArgSet (" -blockmaxweight" )) {
1020+ const auto max_block_weight = args.GetIntArg (" -blockmaxweight" , DEFAULT_BLOCK_MAX_WEIGHT);
1021+ if (max_block_weight > MAX_BLOCK_WEIGHT) {
1022+ return InitError (strprintf (_ (" Specified -blockmaxweight (%d) exceeds consensus maximum block weight (%d)" ), max_block_weight, MAX_BLOCK_WEIGHT));
1023+ }
1024+ }
1025+
10191026 nBytesPerSigOp = args.GetIntArg (" -bytespersigop" , nBytesPerSigOp);
10201027
10211028 if (!g_wallet_init_interface.ParameterInteraction ()) return false ;
Original file line number Diff line number Diff line change @@ -276,6 +276,13 @@ def test_block_max_weight(self):
276276 expected_weight = MAX_BLOCK_WEIGHT - DEFAULT_BLOCK_RESERVED_WEIGHT ,
277277 )
278278
279+ self .log .info ("Test that node will fail to start when user provide invalid -blockmaxweight" )
280+ self .stop_node (0 )
281+ self .nodes [0 ].assert_start_raises_init_error (
282+ extra_args = [f"-blockmaxweight={ MAX_BLOCK_WEIGHT + 1 } " ],
283+ expected_msg = f"Error: Specified -blockmaxweight ({ MAX_BLOCK_WEIGHT + 1 } ) exceeds consensus maximum block weight ({ MAX_BLOCK_WEIGHT } )" ,
284+ )
285+
279286
280287 def run_test (self ):
281288 node = self .nodes [0 ]
You can’t perform that action at this time.
0 commit comments