Browse Source

quit scripts gracefully on walletservice rpc startup failure

master
Adam Gibson 5 years ago
parent
commit
5604857ec1
No known key found for this signature in database
GPG Key ID: 141001A1AF77F20B
  1. 2
      jmclient/jmclient/wallet_utils.py
  2. 2
      scripts/add-utxo.py
  3. 2
      scripts/sendpayment.py
  4. 2
      scripts/tumbler.py

2
jmclient/jmclient/wallet_utils.py

@ -1432,6 +1432,8 @@ def wallet_tool_main(wallet_root_path):
# this object is only to respect the layering,
# the service will not be started since this is a synchronous script:
wallet_service = WalletService(wallet)
if wallet_service.rpc_error:
sys.exit(EXIT_FAILURE)
if method not in noscan_methods and jm_single().bc_interface is not None:
# if nothing was configured, we override bitcoind's options so that

2
scripts/add-utxo.py

@ -172,6 +172,8 @@ def main():
wallet_path = get_wallet_path(options.loadwallet)
wallet = open_wallet(wallet_path, gap_limit=options.gaplimit)
wallet_service = WalletService(wallet)
if wallet_service.rpc_error:
sys.exit(EXIT_FAILURE)
while True:
if wallet_service.sync_wallet(fast=not options.recoversync):
break

2
scripts/sendpayment.py

@ -170,6 +170,8 @@ def main():
wallet_password_stdin=options.wallet_password_stdin,
gap_limit=options.gaplimit)
wallet_service = WalletService(wallet)
if wallet_service.rpc_error:
sys.exit(EXIT_FAILURE)
# in this script, we need the wallet synced before
# logic processing for some paths, so do it now:
while not wallet_service.synced:

2
scripts/tumbler.py

@ -45,6 +45,8 @@ def main():
wallet_path = get_wallet_path(wallet_name, None)
wallet = open_test_wallet_maybe(wallet_path, wallet_name, max_mix_depth, wallet_password_stdin=options_org.wallet_password_stdin)
wallet_service = WalletService(wallet)
if wallet_service.rpc_error:
sys.exit(EXIT_FAILURE)
# in this script, we need the wallet synced before
# logic processing for some paths, so do it now:
while not wallet_service.synced:

Loading…
Cancel
Save