From 2044f705776c059ab5a854cc96bacad4027f04d6 Mon Sep 17 00:00:00 2001 From: Christian Decker Date: Sun, 19 Jul 2020 19:52:18 +0200 Subject: [PATCH] paymod: Count all attempts, not just the ones with a result With the presplitter in particular we would have n attempts but the array contains n+1 entries, which is kinda weird. --- plugins/libplugin-pay.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/plugins/libplugin-pay.c b/plugins/libplugin-pay.c index aa414b2f0..a13dcacac 100644 --- a/plugins/libplugin-pay.c +++ b/plugins/libplugin-pay.c @@ -91,8 +91,7 @@ struct payment_tree_result payment_collect_result(struct payment *p) struct payment_tree_result res; size_t numchildren = tal_count(p->children); res.sent = AMOUNT_MSAT(0); - /* If we didn't have a route, we didn't attempt. */ - res.attempts = p->route == NULL ? 0 : 1; + res.attempts = 1; res.treestates = p->step; res.leafstates = 0; res.preimage = NULL;