]> git.bitcoin.ninja Git - rust-lightning/commit
Build `per_peer_state` immediately in `ChannelManager` deser
authorMatt Corallo <git@bluematt.me>
Fri, 4 Oct 2024 17:54:00 +0000 (17:54 +0000)
committerMatt Corallo <git@bluematt.me>
Tue, 5 Nov 2024 20:13:48 +0000 (20:13 +0000)
commitebf1de5bc79097e03f1099b009098bb380fbc81f
treeba1a326ace1bbede792ca001f4515946ae253e01
parentb423a33bc7e90234b5b9b45a960c59d1d0d2fdc7
Build `per_peer_state` immediately in `ChannelManager` deser

Instead of first building a map from peers to a list of channels
then pulling out of that to build the `per_peer_state`, we build
`per_peer_state` immediately and store channels in it immediately.

This avoids an unnecessary map indirection but also gives us
access to the new fields in `per_peer_state` when reading
`Channel`s which we'll need in a coming commit.
lightning/src/ln/channelmanager.rs
lightning/src/sync/debug_sync.rs
lightning/src/sync/nostd_sync.rs