Skip to content

Commit b3f4631

Browse files
committed
renepay: use askrene-disable-channel
Use the dedicated API for disabling channels instead of workarounds. Signed-off-by: Lagrang3 <[email protected]>
1 parent d47a6f8 commit b3f4631

File tree

1 file changed

+5
-20
lines changed

1 file changed

+5
-20
lines changed

plugins/renepay/mods.c

Lines changed: 5 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -830,11 +830,8 @@ static struct command_result *reserve_routes_cb(struct payment *payment)
830830
route->key.partid, route->final_msg,
831831
fmt_short_channel_id_dir(tmpctx, &scidd));
832832

833-
/* FIXME: there is no askrene-disable-channel,
834-
* we will fake its disabling by setting its
835-
* liquidity to 0 */
836833
struct out_req *req = jsonrpc_request_start(
837-
cmd->plugin, cmd, "askrene-inform-channel",
834+
cmd->plugin, cmd, "askrene-disable-channel",
838835
askrene_disable_channel_done,
839836
askrene_disable_channel_fail, payment);
840837

@@ -844,8 +841,6 @@ static struct command_result *reserve_routes_cb(struct payment *payment)
844841
json_add_short_channel_id(req->js, "short_channel_id",
845842
scidd.scid);
846843
json_add_num(req->js, "direction", scidd.dir);
847-
json_add_amount_msat(req->js, "maximum_msat",
848-
AMOUNT_MSAT(0));
849844
send_outreq(cmd->plugin, req);
850845

851846
payment->pending_rpcs++;
@@ -1267,7 +1262,7 @@ askrene_disable_channel_fail(struct command *cmd, const char *buf,
12671262
{
12681263
plugin_log(
12691264
cmd->plugin, LOG_UNUSUAL,
1270-
"failed to disable channel with askrene-inform-channel: %.*s",
1265+
"failed to disable channel with askrene-disable-channel: %.*s",
12711266
json_tok_full_len(result), json_tok_full(buf, result));
12721267
return askrene_disable_channel_done(cmd, buf, result, payment);
12731268
}
@@ -1330,11 +1325,8 @@ static struct command_result *channelfilter_cb(struct payment *payment)
13301325
pay_plugin->gossmap, chan),
13311326
.dir = dir};
13321327

1333-
/* FIXME: there is no askrene-disable-channel,
1334-
* we will fake its disabling by setting its
1335-
* liquidity to 0 */
13361328
struct out_req *req = jsonrpc_request_start(
1337-
cmd->plugin, cmd, "askrene-inform-channel",
1329+
cmd->plugin, cmd, "askrene-disable-channel",
13381330
askrene_disable_channel_done,
13391331
askrene_disable_channel_fail, payment);
13401332

@@ -1345,8 +1337,6 @@ static struct command_result *channelfilter_cb(struct payment *payment)
13451337
json_add_short_channel_id(
13461338
req->js, "short_channel_id", scidd.scid);
13471339
json_add_num(req->js, "direction", scidd.dir);
1348-
json_add_amount_msat(req->js, "maximum_msat",
1349-
AMOUNT_MSAT(0));
13501340
send_outreq(cmd->plugin, req);
13511341

13521342
payment->pending_rpcs++;
@@ -1378,24 +1368,19 @@ static struct command_result *manualexclusions_cb(struct payment *payment)
13781368
assert(payment);
13791369
struct command *cmd = payment_command(payment);
13801370
assert(cmd);
1381-
1371+
13821372
for(size_t i=0;i<tal_count(payment->exclusions);i++){
13831373
const struct route_exclusion *ex = &payment->exclusions[i];
13841374
if (ex->type == EXCLUDE_CHANNEL) {
1385-
/* FIXME: there is no askrene-disable-channel,
1386-
* we will fake its disabling by setting its
1387-
* liquidity to 0 */
13881375
struct out_req *req = jsonrpc_request_start(
1389-
cmd->plugin, cmd, "askrene-inform-channel",
1376+
cmd->plugin, cmd, "askrene-disable-channel",
13901377
askrene_disable_channel_done,
13911378
askrene_disable_channel_fail, payment);
13921379
json_add_string(req->js, "layer",
13931380
payment->private_layer);
13941381
json_add_short_channel_id(req->js, "short_channel_id",
13951382
ex->u.chan_id.scid);
13961383
json_add_num(req->js, "direction", ex->u.chan_id.dir);
1397-
json_add_amount_msat(req->js, "maximum_msat",
1398-
AMOUNT_MSAT(0));
13991384
send_outreq(cmd->plugin, req);
14001385
payment->pending_rpcs++;
14011386
} else {

0 commit comments

Comments
 (0)