From f1d0325620514c22a5c1fd03d6cdc89180201bc3 Mon Sep 17 00:00:00 2001 From: Christian Decker Date: Wed, 27 Apr 2022 18:35:21 +0200 Subject: [PATCH] topo: Fix issue considering the wrong direction for capacity limits Changelog-Fixed: topology: Under some circumstances we were considering the limits on the wrong direction for a channel --- plugins/topology.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/plugins/topology.c b/plugins/topology.c index 0d8851319..e0807da3d 100644 --- a/plugins/topology.c +++ b/plugins/topology.c @@ -557,9 +557,9 @@ static struct amount_msat peer_capacity(const struct gossmap *gossmap, continue; if (!c->half[!dir].enabled) continue; - if (!amount_msat_add(&capacity, capacity, - amount_msat(fp16_to_u64(c->half[dir] - .htlc_max)))) + if (!amount_msat_add( + &capacity, capacity, + amount_msat(fp16_to_u64(c->half[!dir].htlc_max)))) continue; } return capacity;