1
0

Simplify invoices and requests.

- We need only two types: PR_TYPE_ONCHAIN and PR_TYPE_LN
 - BIP70 is no longer a type, but an optional field in the dict
 - Invoices in the wallet are indexed by a hash of their serialized list of outputs.
 - Requests are still indexed by address, because we never generate Paytomany requests.
 - Add 'clear_invoices' command to CLI
 - Add 'save invoice' button to Qt
This commit is contained in:
ThomasV
2019-09-08 11:59:03 +02:00
parent 1b332748c3
commit aaed594772
10 changed files with 221 additions and 177 deletions

View File

@@ -61,7 +61,6 @@ class PayToEdit(CompletionTextEdit, ScanQRTextEdit, Logger):
self.errors = []
self.is_pr = False
self.is_alias = False
self.is_lightning = False
self.update_size()
self.payto_address = None
self.previous_payto = ''
@@ -143,6 +142,7 @@ class PayToEdit(CompletionTextEdit, ScanQRTextEdit, Logger):
except:
pass
if self.payto_address:
self.win.set_onchain(True)
self.win.lock_amount(False)
return
@@ -153,12 +153,13 @@ class PayToEdit(CompletionTextEdit, ScanQRTextEdit, Logger):
except:
self.errors.append((i, line.strip()))
continue
outputs.append(output)
if output.value == '!':
is_max = True
else:
total += output.value
if outputs:
self.win.set_onchain(True)
self.win.max_button.setChecked(is_max)
self.outputs = outputs