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
This commit is contained in:
Christian Decker 2022-04-27 18:35:21 +02:00 committed by Rusty Russell
parent 0153621b32
commit f1d0325620

View file

@ -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;