pay/sendpay: also store description in case bolt11 uses description_hash.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell
2022-04-02 13:03:35 +10:30
parent d5c736fe86
commit e47786da04
13 changed files with 82 additions and 11 deletions

View File

@@ -716,6 +716,16 @@ def test_invoice_deschash(node_factory, chainparams):
l1.rpc.pay(inv['bolt11'], description=listinv['description'])
# Description will be in some.
found = False
for p in l1.rpc.listsendpays()['payments']:
if 'description' in p:
found = True
assert p['description'] == listinv['description']
assert found
assert only_one(l1.rpc.listpays(inv['bolt11'])['pays'])['description'] == listinv['description']
# Try removing description.
l2.rpc.delinvoice('label', "paid", desconly=True)
assert 'description' not in only_one(l2.rpc.listinvoices()['invoices'])