Skip to content

Commit 192932e

Browse files
committed
renepay: fix plugin bugs
- remove unused local_gossmods - fix failed RPC call to askrene-age when RENEPAY_LAYER does not yet exist - fix plugin hanging if there are no routehints in the invoice Signed-off-by: Lagrang3 <[email protected]>
1 parent b3f4631 commit 192932e

File tree

3 files changed

+4
-11
lines changed

3 files changed

+4
-11
lines changed

plugins/renepay/mods.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -337,7 +337,6 @@ static struct command_result *refreshgossmap_cb(struct payment *payment)
337337
{
338338
assert(pay_plugin->gossmap); // gossmap must be already initialized
339339
assert(payment);
340-
assert(payment->local_gossmods);
341340

342341
size_t num_channel_updates_rejected = 0;
343342
bool gossmap_changed =
@@ -451,7 +450,7 @@ static struct command_result *routehints_cb(struct payment *payment)
451450
end = &r[j].pubkey;
452451
}
453452
}
454-
return command_still_pending(cmd);
453+
return payment_continue(payment);
455454
}
456455

457456
REGISTER_PAYMENT_MODIFIER(routehints, routehints_cb);
@@ -1216,10 +1215,11 @@ static struct command_result *knowledgerelax_cb(struct payment *payment)
12161215
struct command *cmd = payment_command(payment);
12171216
assert(cmd);
12181217

1219-
// FIXME: should relax other layers too?
1218+
/* askrene-age may fail if the layer has not yet been created, in that
1219+
* case we do nothing. */
12201220
struct out_req *req = jsonrpc_request_start(
12211221
cmd->plugin, cmd, "askrene-age", askreneage_success,
1222-
payment_rpc_failure, payment);
1222+
askreneage_success, payment);
12231223

12241224
json_add_string(req->js, "layer", RENEPAY_LAYER);
12251225
json_add_u64(req->js, "cutoff", cutoff);

plugins/renepay/payment.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,6 @@ struct payment *payment_new(
103103
p->pending_rpcs = 0;
104104
p->next_partid = 1;
105105
p->cmd_array = tal_arr(p, struct command *, 0);
106-
p->local_gossmods = NULL;
107106

108107
p->exclusions =
109108
tal_arr(p, struct route_exclusion, tal_count(exclusions));
@@ -135,7 +134,6 @@ static void payment_cleanup(struct payment *p)
135134
p->exec_state = INVALID_STATE;
136135
p->pending_rpcs = 0;
137136
tal_resize(&p->cmd_array, 0);
138-
p->local_gossmods = tal_free(p->local_gossmods);
139137
p->exclusions = tal_free(p->exclusions);
140138
p->waitresult_timer = tal_free(p->waitresult_timer);
141139
routetracker_cleanup(p->routetracker);
@@ -206,8 +204,6 @@ bool payment_update(
206204
assert(p->cmd_array);
207205
assert(tal_count(p->cmd_array) == 0);
208206

209-
p->local_gossmods = tal_free(p->local_gossmods);
210-
211207
p->exclusions = tal_free(p->exclusions);
212208
p->exclusions =
213209
tal_arr(p, struct route_exclusion, tal_count(exclusions));

plugins/renepay/payment.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,6 @@ struct payment {
5555
/* Running commands that want this payment */
5656
struct command **cmd_array;
5757

58-
/* Localmods to apply to gossip_map for our own use. */
59-
struct gossmap_localmods *local_gossmods;
60-
6158
/* Here we queue channel and node disabling orders. */
6259
struct route_exclusion *exclusions;
6360

0 commit comments

Comments
 (0)