Skip to content

Commit

Permalink
lightningd: remove setchannelfee.
Browse files Browse the repository at this point in the history
Replaced by `setchannel`.

Signed-off-by: Rusty Russell <[email protected]>
Changlog-Removed: JSON-RPC: `setchannelfee` (deprecated in v0.11.0)
  • Loading branch information
rustyrussell committed Dec 12, 2022
1 parent 0b6d705 commit 9cc0a32
Show file tree
Hide file tree
Showing 6 changed files with 0 additions and 175 deletions.
1 change: 0 additions & 1 deletion contrib/msggen/msggen/utils/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,6 @@ def load_jsonrpc_service(schema_dir: str):
# "sendcustommsg",
# "sendinvoice",
# "sendonionmessage",
# "setchannelfee",
"SetChannel",
"SignMessage",
# "unreserveinputs",
Expand Down
14 changes: 0 additions & 14 deletions contrib/pyln-client/pyln/client/lightning.py
Original file line number Diff line number Diff line change
Expand Up @@ -1259,20 +1259,6 @@ def sendonion(
}
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').
Expand Down
1 change: 0 additions & 1 deletion doc/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand Down
1 change: 0 additions & 1 deletion doc/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
86 changes: 0 additions & 86 deletions doc/lightning-setchannelfee.7.md

This file was deleted.

72 changes: 0 additions & 72 deletions lightningd/peer_control.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 9cc0a32

Please sign in to comment.