diff --git a/common/gossmods_listpeerchannels.c b/common/gossmods_listpeerchannels.c index 36a24bd6b209..73864241302e 100644 --- a/common/gossmods_listpeerchannels.c +++ b/common/gossmods_listpeerchannels.c @@ -16,7 +16,6 @@ void gossmod_add_localchan(struct gossmap_localmods *mods, u32 fee_proportional, u32 cltv_delta, bool enabled, - bool is_local UNUSED, const char *buf UNUSED, const jsmntok_t *chantok UNUSED, void *cbarg UNUSED) @@ -54,7 +53,6 @@ gossmods_from_listpeerchannels_(const tal_t *ctx, u32 fee_proportional, u32 cltv_delta, bool enabled, - bool is_local, const char *buf, const jsmntok_t *chantok, void *cbarg), @@ -152,7 +150,7 @@ gossmods_from_listpeerchannels_(const tal_t *ctx, /* We add both directions */ cb(mods, self, &dst, &scidd, htlc_min[LOCAL], htlc_max[LOCAL], spendable, fee_base[LOCAL], fee_proportional[LOCAL], - cltv_delta[LOCAL], enabled, true, buf, channel, cbarg); + cltv_delta[LOCAL], enabled, buf, channel, cbarg); /* If we didn't have a remote update, it's not usable yet */ if (fee_proportional[REMOTE] == -1U) @@ -162,7 +160,7 @@ gossmods_from_listpeerchannels_(const tal_t *ctx, cb(mods, self, &dst, &scidd, htlc_min[REMOTE], htlc_max[REMOTE], receivable, fee_base[REMOTE], fee_proportional[REMOTE], - cltv_delta[REMOTE], enabled, false, buf, channel, cbarg); + cltv_delta[REMOTE], enabled, buf, channel, cbarg); } return mods; diff --git a/common/gossmods_listpeerchannels.h b/common/gossmods_listpeerchannels.h index 5b2a68b08c46..a9847c882645 100644 --- a/common/gossmods_listpeerchannels.h +++ b/common/gossmods_listpeerchannels.h @@ -37,7 +37,6 @@ struct gossmap_localmods *gossmods_from_listpeerchannels_(const tal_t *ctx, u32 fee_proportional, u32 cltv_delta, bool enabled, - bool is_local, const char *buf_, const jsmntok_t *chantok, void *cbarg_), @@ -57,7 +56,6 @@ struct gossmap_localmods *gossmods_from_listpeerchannels_(const tal_t *ctx, u32, \ u32, \ bool, \ - bool, \ const char *, \ const jsmntok_t *), \ (cbarg)) @@ -74,7 +72,6 @@ void gossmod_add_localchan(struct gossmap_localmods *mods, u32 fee_proportional, u32 cltv_delta, bool enabled, - bool is_local, const char *buf UNUSED, const jsmntok_t *chantok UNUSED, void *cbarg UNUSED); diff --git a/plugins/renepay/pay.c b/plugins/renepay/pay.c index c0b62398b667..c21805eec9ed 100644 --- a/plugins/renepay/pay.c +++ b/plugins/renepay/pay.c @@ -10,6 +10,7 @@ #include #include #include +#include #include #include #include @@ -465,19 +466,18 @@ static void gossmod_cb(struct gossmap_localmods *mods, u32 fee_proportional, u32 cltv_delta, bool enabled, - bool is_local, const char *buf, const jsmntok_t *chantok, struct payment *payment) { struct amount_msat min, max; - if (is_local) { - /* local channels can send up to what's spendable */ + if (scidd->dir == node_id_idx(self, peer)) { + /* our side of the channel can send up to what's spendable */ min = AMOUNT_MSAT(0); max = spendable; } else { - /* remote channels can send up no more than spendable */ + /* the remote side can send up to no more than spendable */ min = htlcmin; max = amount_msat_min(spendable, htlcmax); } diff --git a/plugins/test/run-route-calc.c b/plugins/test/run-route-calc.c index e4f8f710a864..5a8f74a0a9de 100644 --- a/plugins/test/run-route-calc.c +++ b/plugins/test/run-route-calc.c @@ -49,7 +49,6 @@ void gossmod_add_localchan(struct gossmap_localmods *mods UNNEEDED, u32 fee_proportional UNNEEDED, u32 cltv_delta UNNEEDED, bool enabled UNNEEDED, - bool is_local UNNEEDED, const char *buf UNUSED UNNEEDED, const jsmntok_t *chantok UNUSED UNNEEDED, void *cbarg UNUSED UNNEEDED) @@ -71,7 +70,6 @@ struct gossmap_localmods *gossmods_from_listpeerchannels_(const tal_t *ctx UNNEE u32 fee_proportional UNNEEDED, u32 cltv_delta UNNEEDED, bool enabled UNNEEDED, - bool is_local UNNEEDED, const char *buf_ UNNEEDED, const jsmntok_t *chantok UNNEEDED, void *cbarg_) UNNEEDED, diff --git a/plugins/test/run-route-overlong.c b/plugins/test/run-route-overlong.c index 96d74ff43ce5..a6e0a5a00e22 100644 --- a/plugins/test/run-route-overlong.c +++ b/plugins/test/run-route-overlong.c @@ -46,7 +46,6 @@ void gossmod_add_localchan(struct gossmap_localmods *mods UNNEEDED, u32 fee_proportional UNNEEDED, u32 cltv_delta UNNEEDED, bool enabled UNNEEDED, - bool is_local UNNEEDED, const char *buf UNUSED UNNEEDED, const jsmntok_t *chantok UNUSED UNNEEDED, void *cbarg UNUSED UNNEEDED) @@ -68,7 +67,6 @@ struct gossmap_localmods *gossmods_from_listpeerchannels_(const tal_t *ctx UNNEE u32 fee_proportional UNNEEDED, u32 cltv_delta UNNEEDED, bool enabled UNNEEDED, - bool is_local UNNEEDED, const char *buf_ UNNEEDED, const jsmntok_t *chantok UNNEEDED, void *cbarg_) UNNEEDED, diff --git a/plugins/topology.c b/plugins/topology.c index 14054324ecdd..ecd97443e9ea 100644 --- a/plugins/topology.c +++ b/plugins/topology.c @@ -369,7 +369,6 @@ static void gossmod_add_unknown_localchan(struct gossmap_localmods *mods, u32 fee_proportional, u32 cltv_delta, bool enabled, - bool is_local, const char *buf UNUSED, const jsmntok_t *chantok UNUSED, struct gossmap *gossmap) @@ -379,7 +378,7 @@ static void gossmod_add_unknown_localchan(struct gossmap_localmods *mods, gossmod_add_localchan(mods, self, peer, scidd, min, max, spendable, fee_base, fee_proportional, cltv_delta, enabled, - is_local, buf, chantok, gossmap); + buf, chantok, gossmap); } /* FIXME: We don't need this listpeerchannels at all if not deprecated! */