diff --git a/contrib/msggen/msggen/utils/utils.py b/contrib/msggen/msggen/utils/utils.py index f9194169b..883757b47 100644 --- a/contrib/msggen/msggen/utils/utils.py +++ b/contrib/msggen/msggen/utils/utils.py @@ -97,7 +97,6 @@ def load_jsonrpc_service(schema_dir: str): # "sendcustommsg", # "sendinvoice", # "sendonionmessage", - # "setchannelfee", "SetChannel", "SignMessage", # "unreserveinputs", diff --git a/contrib/pyln-client/pyln/client/lightning.py b/contrib/pyln-client/pyln/client/lightning.py index 5687d7257..28b2f0da2 100644 --- a/contrib/pyln-client/pyln/client/lightning.py +++ b/contrib/pyln-client/pyln/client/lightning.py @@ -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'). diff --git a/doc/Makefile b/doc/Makefile index 1212d8341..4bc98106d 100644 --- a/doc/Makefile +++ b/doc/Makefile @@ -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 \ diff --git a/doc/index.rst b/doc/index.rst index 9a778ca67..68498827a 100644 --- a/doc/index.rst +++ b/doc/index.rst @@ -113,7 +113,6 @@ Core Lightning Documentation lightning-sendpay lightning-sendpsbt lightning-setchannel - lightning-setchannelfee lightning-signmessage lightning-signpsbt lightning-staticbackup diff --git a/doc/lightning-setchannelfee.7.md b/doc/lightning-setchannelfee.7.md deleted file mode 100644 index e6d290a8c..000000000 --- a/doc/lightning-setchannelfee.7.md +++ /dev/null @@ -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 <> is the author of this -feature. Rusty Russell <> is mainly -responsible for the Core Lightning project. - -SEE ALSO --------- - -lightningd-setchannel(7) - -RESOURCES ---------- - -Main web site: - -[comment]: # ( SHA256STAMP:f4de7a0b01820a22b9b8f20e2cce249d3b0d2be10346e745e1066b101a37df3d) diff --git a/lightningd/peer_control.c b/lightningd/peer_control.c index cafdb6256..b6447714d 100644 --- a/lightningd/peer_control.c +++ b/lightningd/peer_control.c @@ -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,