Browse Source
wallet._is_onchain_invoice_paid: support "zero amount" invoice
hard-fail-on-bad-server-string
SomberNight
5 years ago
No known key found for this signature in database
GPG Key ID: B33B5F232C6271E9
1 changed files with
4 additions and
0 deletions
-
electrum/wallet.py
|
@ -679,6 +679,10 @@ class Abstract_Wallet(AddressSynchronizer, ABC): |
|
|
prevouts_and_values = self.db.get_prevouts_by_scripthash(scripthash) |
|
|
prevouts_and_values = self.db.get_prevouts_by_scripthash(scripthash) |
|
|
relevant_txs += [prevout.txid.hex() for prevout, v in prevouts_and_values] |
|
|
relevant_txs += [prevout.txid.hex() for prevout, v in prevouts_and_values] |
|
|
total_received = sum([v 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: |
|
|
if total_received < invoice_amt: |
|
|
return False, [] |
|
|
return False, [] |
|
|
return True, relevant_txs |
|
|
return True, relevant_txs |
|
|