Browse Source

wallet._is_onchain_invoice_paid: support "zero amount" invoice

hard-fail-on-bad-server-string
SomberNight 5 years ago
parent
commit
79681c90e0
No known key found for this signature in database GPG Key ID: B33B5F232C6271E9
  1. 4
      electrum/wallet.py

4
electrum/wallet.py

@ -679,6 +679,10 @@ class Abstract_Wallet(AddressSynchronizer, ABC):
prevouts_and_values = self.db.get_prevouts_by_scripthash(scripthash)
relevant_txs += [prevout.txid.hex() for prevout, v in prevouts_and_values]
total_received = sum([v for prevout, v in prevouts_and_values])
# check that there is at least one TXO, and that they pay enough.
# note: "at least one TXO" check is needed for zero amount invoice (e.g. OP_RETURN)
if len(prevouts_and_values) == 0:
return False, []
if total_received < invoice_amt:
return False, []
return True, relevant_txs

Loading…
Cancel
Save