Skip `channel_update` signature checks if we have a newer state 2022-03-skip-redundant-sig-checks
authorMatt Corallo <git@bluematt.me>
Wed, 23 Mar 2022 22:10:15 +0000 (22:10 +0000)
committerMatt Corallo <git@bluematt.me>
Thu, 24 Mar 2022 17:21:30 +0000 (17:21 +0000)
commit63ca72e5b06e3dc826935541aab7b69f34e3310d
treed2ece8dda8c6f34893aca31d54941256475c80fa
parentfcfd683312c705c2e5150529ed0e680a66ee503c
Skip `channel_update` signature checks if we have a newer state

`channel_update` messages already have their signatures checked
with the network graph write lock held, so there's no reason to
check the signatures before doing other quicker checks first,
including checking if we're already aware of a newer update for the
channel.

This reduces common-case CPU usage as `channel_update`s are sent
rather liberally over the p2p network to gossip them.
lightning/src/routing/network_graph.rs