]> git.bitcoin.ninja Git - rust-lightning/commit
Call `ChannelMessageHandler::message_received` without peer lock 2024-09-3010-followups
authorMatt Corallo <git@bluematt.me>
Thu, 12 Sep 2024 15:17:15 +0000 (15:17 +0000)
committerMatt Corallo <git@bluematt.me>
Mon, 30 Sep 2024 18:57:52 +0000 (18:57 +0000)
commitd156b2e30e488539e49fe014cf31ebdb17fd026a
tree442f917bd54fe2799baf995315d38c445bcdfef1
parentb8695b0c8347e5500ecd78a740247748669b3814
Call `ChannelMessageHandler::message_received` without peer lock

While `message_received` purports to be called on every message,
prior to the message, doing so on `Init` messages means we have to
call `message_received` while holding the per-peer mutex, which
can cause some lock contention.

Instead, here, we call `message_received` after processing `Init`
messages (which is probably more useful anyway - the peer isn't
really "connected" until we've processed the `Init` messages),
allowing us to call it unlocked.
lightning/src/ln/peer_handler.rs