From 2532e8bfbf25c196d396b3d6566923ccc477ad14 Mon Sep 17 00:00:00 2001 From: Christian Decker Date: Wed, 6 Jul 2022 17:38:49 +0200 Subject: [PATCH] pay: If the channel_hint matches our allocation allow it It means we consume the channel completely to the best of our knowledge, so let that through. Changelog-Fixed: pay: Squeezed out the last `msat` from our local view of the network --- plugins/libplugin-pay.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/plugins/libplugin-pay.c b/plugins/libplugin-pay.c index 8950b30b9e8f..9b40c3b35a94 100644 --- a/plugins/libplugin-pay.c +++ b/plugins/libplugin-pay.c @@ -515,8 +515,8 @@ static bool payment_chanhints_apply_route(struct payment *p, bool remove) /* For all channels we check that they have a * sufficiently large estimated capacity to have some * chance of succeeding. */ - apply &= amount_msat_greater(curhint->estimated_capacity, - curhop->amount); + apply &= amount_msat_greater_eq(curhint->estimated_capacity, + curhop->amount); if (!apply) { /* This can happen in case of multiple @@ -530,6 +530,15 @@ static bool payment_chanhints_apply_route(struct payment *p, bool remove) type_to_string(tmpctx, struct short_channel_id_dir, &curhint->scid)); + paymod_log( + p, LOG_DBG, + "Capacity: estimated_capacity=%s, hop_amount=%s. " + "HTLC Budget: htlc_budget=%d, local=%d", + type_to_string(tmpctx, struct amount_msat, + &curhint->estimated_capacity), + type_to_string(tmpctx, struct amount_msat, + &curhop->amount), + curhint->htlc_budget, curhint->local); return false; } }