]> git.bitcoin.ninja Git - rust-lightning/commit
Track in-flight `channel_announcement` lookups and avoid duplicates
authorMatt Corallo <git@bluematt.me>
Wed, 8 Feb 2023 22:11:56 +0000 (22:11 +0000)
committerMatt Corallo <git@bluematt.me>
Wed, 8 Feb 2023 23:54:30 +0000 (23:54 +0000)
commit7388b6c1d795a5cbbf2c6c109bacd26e15c81500
tree2c1bcc3c850ef485fa53eac599c689f2579015cb
parent2cca65058e4ce3e0120a3fe78a14ed82d1c3a43b
Track in-flight `channel_announcement` lookups and avoid duplicates

If we receive two `channel_announcement`s for the same channel at
the same time, we shouldn't spawn a second UTXO lookup for an
identical message. This likely isn't too rare - if we start syncing
the graph from two peers at the same time, it isn't unlikely that
we'll end up with the same messages around the same time.

In order to avoid this we keep a hash map of all the pending
`channel_announcement` messages by SCID and simply ignore duplicate
message lookups.
lightning/src/routing/utxo.rs