lightningd: new setchannel command.

Based on setchannelfee, but expanded to allow setting max htlc amount (and others
in future?).

The main differences:
1. It doesn't change values which are not specified (that would be hard to
   add fields to!)
2. It says exactly what all values are in any potentially changed channels.

Changelog-Added: JSON-RPC: new `setchannel` command generalizes `setchannelfee`.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell
2022-03-21 11:28:28 +10:30
parent 4fdcee9a11
commit 66e264d6b3
6 changed files with 274 additions and 14 deletions

View File

@@ -1176,6 +1176,31 @@ class LightningRpc(UnixDomainSocketRpc):
}
return self.call("setchannelfee", payload)
def setchannel(self, id, feebase=None, feeppm=None, htlcmax=None, enforcedelay=None):
"""Set configuration a channel/peer {id} (or 'all').
{feebase} is a value in millisatoshi that is added as base fee
to any routed payment.
{feeppm} is a value added proportionally per-millionths to any
routed payment volume in satoshi.
{htlcmax} is the maximum (outgoing) htlc amount to allow and
advertize.
{enforcedelay} is the number of seconds before enforcing this
change.
"""
payload = {
"id": id,
"feebase": feebase,
"feeppm": feeppm,
"htlcmax": htlcmax,
"enforcedelay": enforcedelay,
}
return self.call("setchannel", payload)
def stop(self):
"""
Shut down the lightningd process.