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)
1016
1016
}
1017
1017
}
1018
1018
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
+
1019
1026
nBytesPerSigOp = args.GetIntArg (" -bytespersigop" , nBytesPerSigOp);
1020
1027
1021
1028
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):
276
276
expected_weight = MAX_BLOCK_WEIGHT - DEFAULT_BLOCK_RESERVED_WEIGHT ,
277
277
)
278
278
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
+
279
286
280
287
def run_test (self ):
281
288
node = self .nodes [0 ]
You can’t perform that action at this time.
0 commit comments