1
0

Qt: allow to save invoices that have no amount

(such invoices are already saved by the QML GUI.)
This commit is contained in:
ThomasV
2023-03-19 09:39:04 +01:00
parent 5ab3a250c5
commit c3e52bfafc
4 changed files with 16 additions and 8 deletions

View File

@@ -161,7 +161,8 @@ class BaseInvoice(StoredObject):
Returns an integer satoshi amount, or '!' or None.
Callers who need msat precision should call get_amount_msat()
"""
amount_msat = self.amount_msat
# return strictly positive value or None
amount_msat = self.amount_msat or None
if amount_msat in [None, "!"]:
return amount_msat
return int(amount_msat // 1000)