Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support locked Bitcoin wallets in sidechain manipulation script #44

Closed
wants to merge 6 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions contrib/sidechain-manipulation.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,14 @@ def __init__(self, value):

txid = bitcoin.sendrawtransaction(tx_hex)
except:
# Compensate for <0.9 BC Core by gracefully handling the "already unlocked" wallet case.
try:
bitcoin.walletpassphrase('walletPassword', 1000)
except JSONRPCException as e:
if e.error['code'] != '-17':
print("Got the following error from an RPC Call:")
print(e.error)
sys.exit()
txid = bitcoin.sendtoaddress(send_address, Decimal(sys.argv[3]))

print("Sent tx with id %s" % txid)
Expand Down