renepay: skip channels disabled in gossmap
What changed, and why it matters
This fix corrects a routing bug in Core Lightning's 'renepay' payment plugin. Previously, renepay could try to send payments through Lightning channels that the wider network had already marked as disabled, causing payment attempts to fail and wasting network round-trips. The patch makes renepay respect the disabled flag from network gossip, so it avoids those channels upfront. It is a reliability/efficiency fix rather than a direct theft-of-funds vulnerability.
Apply the patch. Monitor for any related routing inefficiency or edge cases where disabled flags are stale. No emergency response is indicated; this is a routine reliability fix.
Security signals we found
Logic omission in route eligibility check
Ignored disabled flag from gossip store
Potential for resource-wasting HTLC retries through known-bad channels
No input validation, memory safety, or cryptographic issue visible in diff
Evidence from the diff
In plugins/renepay/mcf.c, channel_is_available() now checks c->half[dir].enabled before considering a gossip channel usable. Before, it only verified that a channel_update existed (gossmap_chan_set) and that renepay’s local disabled bitmap had not flagged the channel. Because it ignored gossmap’s half_chan.enabled flag, the minimum-cost-flow (MCF) payment-routing model could include channels that the gossip_store already reported as disabled, leading to avoidable HTLC failures and retries.
Changed components
plugins/renepay/mcf.crenepay minimum-cost-flow routingInspect captured patch +2 / −0
diff --git a/plugins/renepay/mcf.c b/plugins/renepay/mcf.c
index 8fdd067b..51851b97 100644
--- a/plugins/renepay/mcf.c
+++ b/plugins/renepay/mcf.c
@@ -449,6 +449,8 @@ static bool channel_is_available(const struct gossmap_chan *c, int dir,
{
if (!gossmap_chan_set(c, dir))
return false;
+ if (!c->half[dir].enabled)
+ return false;
const u32 chan_idx = gossmap_chan_idx(gossmap, c);
return !bitmap_test_bit(disabled, chan_idx * 2 + dir);
Why this scored 26/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.