pay: require description if bolt11 only has hash.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Changelog-Added: JSON-RPC: `pay` has `description` parameter, will be required if bolt11 only has a hash.
Changelog-Deprecated: JSON-RPC: `pay` for a bolt11 which uses a `description_hash`, without setting `description`.
This commit is contained in:
Rusty Russell
2022-04-02 13:03:05 +10:30
parent 6c54e0e7e7
commit d5c736fe86
6 changed files with 41 additions and 7 deletions

View File

@@ -998,7 +998,7 @@ class LightningRpc(UnixDomainSocketRpc):
def pay(self, bolt11, msatoshi=None, label=None, riskfactor=None,
maxfeepercent=None, retry_for=None,
maxdelay=None, exemptfee=None, localofferid=None, exclude=None,
maxfee=None):
maxfee=None, description=None):
"""
Send payment specified by {bolt11} with {msatoshi}
(ignored if {bolt11} has an amount), optional {label}
@@ -1016,6 +1016,7 @@ class LightningRpc(UnixDomainSocketRpc):
"localofferid": localofferid,
"exclude": exclude,
"maxfee": maxfee,
"description": description,
}
return self.call("pay", payload)