delinvoice: allow desconly arg to only remove the description.

Means that field is now optional in JSON output.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Changelog-Added: JSON-RPC: `delinvoice` has a new parameter `desconly` to remove description.
This commit is contained in:
Rusty Russell
2022-03-24 10:27:28 +10:30
parent ccaf04d268
commit aad4495f56
13 changed files with 110 additions and 36 deletions

View File

@@ -566,13 +566,14 @@ class LightningRpc(UnixDomainSocketRpc):
}
return self.call("delexpiredinvoice", payload)
def delinvoice(self, label, status):
def delinvoice(self, label, status, desconly=None):
"""
Delete unpaid invoice {label} with {status}.
Delete unpaid invoice {label} with {status} (or, with {desconly} true, remove its description).
"""
payload = {
"label": label,
"status": status
"status": status,
"desconly": desconly,
}
return self.call("delinvoice", payload)