lightningd: remove `setchannelfee`.

Replaced by `setchannel`.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Changlog-Removed: JSON-RPC: `setchannelfee` (deprecated in v0.11.0)
This commit is contained in:
Rusty Russell 2022-12-12 17:00:37 +10:30
parent 62333425c2
commit 5b3746172f
6 changed files with 0 additions and 175 deletions

View File

@ -97,7 +97,6 @@ def load_jsonrpc_service(schema_dir: str):
# "sendcustommsg",
# "sendinvoice",
# "sendonionmessage",
# "setchannelfee",
"SetChannel",
"SignMessage",
# "unreserveinputs",

View File

@ -1259,20 +1259,6 @@ class LightningRpc(UnixDomainSocketRpc):
}
return self.call("sendonion", payload)
def setchannelfee(self, id, base=None, ppm=None, enforcedelay=None):
"""
Set routing fees for a channel/peer {id} (or 'all'). {base} is a value in millisatoshi
that is added as base fee to any routed payment. {ppm} is a value added proportionally
per-millionths to any routed payment volume in satoshi. {enforcedelay} is the number of seconds before enforcing this change.
"""
payload = {
"id": id,
"base": base,
"ppm": ppm,
"enforcedelay": enforcedelay,
}
return self.call("setchannelfee", payload)
def setchannel(self, id, feebase=None, feeppm=None, htlcmin=None, htlcmax=None, enforcedelay=None):
"""Set configuration a channel/peer {id} (or 'all').

View File

@ -81,7 +81,6 @@ MANPAGES := doc/lightning-cli.1 \
doc/lightning-sendonionmessage.7 \
doc/lightning-sendpay.7 \
doc/lightning-setchannel.7 \
doc/lightning-setchannelfee.7 \
doc/lightning-sendcustommsg.7 \
doc/lightning-signmessage.7 \
doc/lightning-staticbackup.7 \

View File

@ -113,7 +113,6 @@ Core Lightning Documentation
lightning-sendpay <lightning-sendpay.7.md>
lightning-sendpsbt <lightning-sendpsbt.7.md>
lightning-setchannel <lightning-setchannel.7.md>
lightning-setchannelfee <lightning-setchannelfee.7.md>
lightning-signmessage <lightning-signmessage.7.md>
lightning-signpsbt <lightning-signpsbt.7.md>
lightning-staticbackup <lightning-staticbackup.7.md>

View File

@ -1,86 +0,0 @@
lightning-setchannelfee -- Command for setting specific routing fees on a lightning channel
===========================================================================================
SYNOPSIS
--------
(DEPRECATED) **setchannelfee** *id* [*base*] [*ppm*] [*enforcedelay*]
DESCRIPTION
-----------
The **setchannelfee** RPC command sets channel specific routing fees as
defined in BOLT \#7. The channel has to be in normal or awaiting state.
This can be checked by **listpeers** reporting a *state* of
CHANNELD\_NORMAL, CHANNELD\_AWAITING\_LOCKIN or DUALOPEND\_AWAITING\_LOCKIN for the channel.
*id* is required and should contain a scid (short channel ID), channel
id or peerid (pubkey) of the channel to be modified. If *id* is set to
"all", the fees for all channels are updated that are in state
CHANNELD\_NORMAL, CHANNELD\_AWAITING\_LOCKIN or
DUALOPEND\_AWAITING\_LOCKIN. If *id* is a peerid, all channels with the
peer in those states are changed.
*base* is an optional value in millisatoshi that is added as base fee to
any routed payment. If the parameter is left out, the global config
value fee-base will be used again. It can be a whole number, or a whole
number ending in *msat* or *sat*, or a number with three decimal places
ending in *sat*, or a number with 1 to 11 decimal places ending in
*btc*.
*ppm* is an optional value that is added proportionally per-millionths
to any routed payment volume in satoshi. For example, if ppm is 1,000
and 1,000,000 satoshi is being routed through the channel, an
proportional fee of 1,000 satoshi is added, resulting in a 0.1% fee. If
the parameter is left out, the global config value will be used again.
*enforcedelay* is the number of seconds to delay before enforcing the
new fees (default 600, which is ten minutes). This gives the network
a chance to catch up with the new rates and avoids rejecting HTLCs
before they do. This only has an effect if rates are increased (we
always allow users to overpay fees), only applies to a single rate
increase per channel (we don't remember an arbitrary number of prior
feerates) and if the node is restarted the updated fees are enforced
immediately.
RETURN VALUE
------------
[comment]: # (GENERATE-FROM-SCHEMA-START)
On success, an object is returned, containing:
- **base** (u32): The fee\_base\_msat value
- **ppm** (u32): The fee\_proportional\_millionths value
- **channels** (array of objects): channel(s) whose rate is now set:
- **peer\_id** (pubkey): The node\_id of the peer
- **channel\_id** (hex): The channel\_id of the channel (always 64 characters)
- **short\_channel\_id** (short\_channel\_id, optional): the short\_channel\_id (if locked in)
[comment]: # (GENERATE-FROM-SCHEMA-END)
ERRORS
------
The following error codes may occur:
- -1: Channel is in incorrect state, i.e. Catchall nonspecific error.
- -32602: JSONRPC2\_INVALID\_PARAMS, i.e. Given id is not a channel ID
or short channel ID.
AUTHOR
------
Michael Schmoock <<michael@schmoock.net>> is the author of this
feature. Rusty Russell <<rusty@rustcorp.com.au>> is mainly
responsible for the Core Lightning project.
SEE ALSO
--------
lightningd-setchannel(7)
RESOURCES
---------
Main web site: <https://github.com/ElementsProject/lightning>
[comment]: # ( SHA256STAMP:f4de7a0b01820a22b9b8f20e2cce249d3b0d2be10346e745e1066b101a37df3d)

View File

@ -2623,78 +2623,6 @@ static void set_channel_config(struct command *cmd, struct channel *channel,
json_object_end(response);
}
static struct command_result *json_setchannelfee(struct command *cmd,
const char *buffer,
const jsmntok_t *obj UNNEEDED,
const jsmntok_t *params)
{
struct json_stream *response;
struct peer *peer;
struct channel **channels;
u32 *base, *ppm, *delaysecs;
/* Parse the JSON command */
if (!param(cmd, buffer, params,
p_req("id", param_channel_or_all, &channels),
p_opt_def("base", param_msat_u32,
&base, cmd->ld->config.fee_base),
p_opt_def("ppm", param_number, &ppm,
cmd->ld->config.fee_per_satoshi),
/* BOLT #7:
* If it creates a new `channel_update` with updated channel parameters:
* - SHOULD keep accepting the previous channel parameters for 10 minutes
*/
p_opt_def("enforcedelay", param_number, &delaysecs, 600),
NULL))
return command_param_failed();
/* Open JSON response object for later iteration */
response = json_stream_success(cmd);
json_add_num(response, "base", *base);
json_add_num(response, "ppm", *ppm);
json_array_start(response, "channels");
/* If the users requested 'all' channels we need to iterate */
if (channels == NULL) {
list_for_each(&cmd->ld->peers, peer, list) {
struct channel *channel;
list_for_each(&peer->channels, channel, list) {
if (channel->state != CHANNELD_NORMAL &&
channel->state != CHANNELD_AWAITING_LOCKIN &&
channel->state != DUALOPEND_AWAITING_LOCKIN)
continue;
set_channel_config(cmd, channel, base, ppm, NULL, NULL,
*delaysecs, response, false);
}
}
/* single peer should be updated */
} else {
for (size_t i = 0; i < tal_count(channels); i++) {
set_channel_config(cmd, channels[i], base, ppm, NULL, NULL,
*delaysecs, response, false);
}
}
/* Close and return response */
json_array_end(response);
return command_success(cmd, response);
}
static const struct json_command setchannelfee_command = {
"setchannelfee",
"channels",
json_setchannelfee,
"Sets specific routing fees for channel with {id} "
"(either peer ID, channel ID, short channel ID or 'all'). "
"Routing fees are defined by a fixed {base} (msat) "
"and a {ppm} (proportional per millionth) value. "
"If values for {base} or {ppm} are left out, defaults will be used. "
"{base} can also be defined in other units, for example '1sat'. "
"If {id} is 'all', the fees will be applied for all channels. ",
true /* deprecated */
};
AUTODATA(json_command, &setchannelfee_command);
static struct command_result *json_setchannel(struct command *cmd,
const char *buffer,
const jsmntok_t *obj UNNEEDED,