@@ -365,7 +365,7 @@ def stop_node(self, expected_stderr='', *, wait=0, wait_until_stopped=True):
365
365
if wait_until_stopped :
366
366
self .wait_until_stopped ()
367
367
368
- def is_node_stopped (self , expected_ret_code = None ):
368
+ def is_node_stopped (self , expected_ret_code = 0 ):
369
369
"""Checks whether the node has stopped.
370
370
371
371
Returns True if the node has stopped. False otherwise.
@@ -377,13 +377,8 @@ def is_node_stopped(self, expected_ret_code=None):
377
377
return False
378
378
379
379
# process has stopped. Assert that it didn't return an error code.
380
- # unless 'expected_ret_code' is provided.
381
- if expected_ret_code is not None :
382
- assert return_code == expected_ret_code , self ._node_msg (
383
- "Node returned unexpected exit code (%d) vs (%d) when stopping" % (return_code , expected_ret_code ))
384
- else :
385
- assert return_code == 0 , self ._node_msg (
386
- "Node returned non-zero exit code (%d) when stopping" % return_code )
380
+ assert return_code == expected_ret_code , self ._node_msg (
381
+ f"Node returned unexpected exit code ({ return_code } ) vs ({ expected_ret_code } ) when stopping" )
387
382
self .running = False
388
383
self .process = None
389
384
self .rpc_connected = False
@@ -392,7 +387,7 @@ def is_node_stopped(self, expected_ret_code=None):
392
387
return True
393
388
394
389
def wait_until_stopped (self , timeout = BITCOIND_PROC_WAIT_TIMEOUT , expect_error = False ):
395
- expected_ret_code = 1 if expect_error else None # Whether node shutdown return EXIT_FAILURE or EXIT_SUCCESS
390
+ expected_ret_code = 1 if expect_error else 0 # Whether node shutdown return EXIT_FAILURE or EXIT_SUCCESS
396
391
wait_until_helper (lambda : self .is_node_stopped (expected_ret_code = expected_ret_code ), timeout = timeout , timeout_factor = self .timeout_factor )
397
392
398
393
def replace_in_config (self , replacements ):
0 commit comments