From 63c8aeb54c9f161b6bfca73c77304a7e3e088ca9 Mon Sep 17 00:00:00 2001 From: SomberNight Date: Fri, 22 Apr 2022 16:46:47 +0200 Subject: [PATCH] wallet: fix paying invoice with "max" amount fixes https://github.com/spesmilo/electrum/pull/7774 --- electrum/wallet.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/electrum/wallet.py b/electrum/wallet.py index 1993c8d7e..b0c78c48e 100644 --- a/electrum/wallet.py +++ b/electrum/wallet.py @@ -776,13 +776,13 @@ class Abstract_Wallet(AddressSynchronizer, ABC): height=self.get_local_height() if pr: return Invoice.from_bip70_payreq(pr, height) - amount = 0 + amount_msat = 0 for x in outputs: if parse_max_spend(x.value): - amount = '!' + amount_msat = '!' break else: - amount += x.value + amount_msat += x.value * 1000 timestamp = None exp = None if URI: @@ -791,7 +791,7 @@ class Abstract_Wallet(AddressSynchronizer, ABC): timestamp = timestamp or int(time.time()) exp = exp or 0 invoice = Invoice( - amount_msat=amount*1000, + amount_msat=amount_msat, message=message, time=timestamp, exp=exp,