]> git.bitcoin.ninja Git - rust-lightning/commit
Require directional updates for a `DirectionalChannelInfo`
authorMatt Corallo <git@bluematt.me>
Sat, 29 Oct 2022 18:24:36 +0000 (18:24 +0000)
committerMatt Corallo <git@bluematt.me>
Sat, 29 Oct 2022 20:38:54 +0000 (20:38 +0000)
commit81afc2f1729b2abf5eaa54c5da12f517349486a7
tree25c75842b45789824064b5c5f5aa3931ee002bf7
parent6957fb63f97546f65f590f191b4c3f181fb62ec7
Require directional updates for a `DirectionalChannelInfo`

We currently construct `DirectedChannelInfo`s for routing before
checking if the given direction has its directional info filled in.
We then always check for directional info before actually deciding
to route over a channel, as otherwise we assume the channel is not
online.

This makes for somewhat redundant checks, and `DirectedCHannelInfo`
isn't, by itself, a very useful API. Because fetching the HTLC-max
or effective channel capacity gives spurious data if no directional
info is available, there's little reason to have that data
available, and so we here check for directional info first. This
effectively merges `DirectionalChannelInfo` and
`DirectionalChannelInfoWithUpdate`.
lightning/src/routing/gossip.rs
lightning/src/routing/router.rs