Skip to content

Commit 56fa832

Browse files
committed
wallet.get_tx_parents: explicitly handle missing "from address"
(happened to work even without this)
1 parent a1bfea6 commit 56fa832

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

electrum/address_synchronizer.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -787,7 +787,7 @@ def get_tx_fee(self, txid: str) -> Optional[int]:
787787
self.db.add_num_inputs_to_tx(txid, len(tx.inputs()))
788788
return fee
789789

790-
def get_addr_io(self, address):
790+
def get_addr_io(self, address: str):
791791
with self.lock, self.transaction_lock:
792792
h = self.get_address_history(address).items()
793793
received = {}

electrum/wallet.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -922,6 +922,8 @@ def get_tx_parents(self, txid: str) -> Dict[str, Tuple[List[str], List[str]]]:
922922
parents.append(_txid)
923923
# detect address reuse
924924
addr = self.adb.get_txin_address(txin)
925+
if addr is None:
926+
continue
925927
received, sent = self.adb.get_addr_io(addr)
926928
if len(sent) > 1:
927929
my_txid, my_height, my_pos = sent[txin.prevout.to_str()]

0 commit comments

Comments
 (0)