From 42dbd9025adc200012c103d2c091cf026f1d50b1 Mon Sep 17 00:00:00 2001 From: Sebastian Falbesoner Date: Sat, 7 Aug 2021 20:48:15 +0200 Subject: contrib: return non-zero status if getcoins.py errors --- contrib/signet/getcoins.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'contrib') diff --git a/contrib/signet/getcoins.py b/contrib/signet/getcoins.py index 86755e6305..dc203f1254 100755 --- a/contrib/signet/getcoins.py +++ b/contrib/signet/getcoins.py @@ -30,11 +30,11 @@ def bitcoin_cli(rpc_command_and_params): return subprocess.check_output(argv).strip().decode() except FileNotFoundError: print('The binary', args.cmd, 'could not be found.') - exit() + exit(1) except subprocess.CalledProcessError: cmdline = ' '.join(argv) print(f'-----\nError while calling "{cmdline}" (see output above).') - exit() + exit(1) if args.faucet.lower() == DEFAULT_GLOBAL_FAUCET: @@ -42,7 +42,7 @@ if args.faucet.lower() == DEFAULT_GLOBAL_FAUCET: curr_signet_hash = bitcoin_cli(['getblockhash', '1']) if curr_signet_hash != GLOBAL_FIRST_BLOCK_HASH: print('The global faucet cannot be used with a custom Signet network. Please use the global signet or setup your custom faucet to use this functionality.\n') - exit() + exit(1) if args.addr == '': # get address for receiving coins @@ -53,7 +53,7 @@ try: res = requests.post(args.faucet, data=data) except: print('Unexpected error when contacting faucet:', sys.exc_info()[0]) - exit() + exit(1) # Display the output as per the returned status code if res: -- cgit v1.2.3