Skip to content
This repository has been archived by the owner on May 13, 2022. It is now read-only.

Catch IndexError when deserializing wallet transactions #763

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
13 changes: 9 additions & 4 deletions wallet-tool.py
Original file line number Diff line number Diff line change
Expand Up @@ -459,12 +459,17 @@ def skip_n1_btc(v):
try:
wallet_tx = jm_single().bc_interface.rpc('gettransaction',
[ins['outpoint']['hash']])
input_dict = btc.deserialize(str(wallet_tx['hex']))['outs'][ins[
'outpoint']['index']]
rpc_inputs.append(input_dict)
except JsonRpcError:
continue
input_dict = btc.deserialize(str(wallet_tx['hex']))['outs'][ins[
'outpoint']['index']]
rpc_inputs.append(input_dict)

except IndexError:
print("\n")
print(ins)
print("\n")
print(btc.deserialize(str(wallet_tx['hex'])))
print("\n")
rpc_input_addrs = set((btc.script_to_address(ind['script'],
get_p2pk_vbyte()) for ind in rpc_inputs))
our_input_addrs = wallet_addr_set.intersection(rpc_input_addrs)
Expand Down