Avoid taking the peers write lock during event processing
authorMatt Corallo <git@bluematt.me>
Sat, 25 Sep 2021 22:24:23 +0000 (22:24 +0000)
committerMatt Corallo <git@bluematt.me>
Tue, 10 May 2022 23:40:20 +0000 (23:40 +0000)
commita5adda18dc2c05959c107a0b2769730680d32d18
tree66230683c4742f403600b377e94942d6eaf11c44
parentb1550524cfe2689e3743ddfc0a78527d26de8613
Avoid taking the peers write lock during event processing

Because the peers write lock "blocks the world", and happens after
each read event, always taking the write lock has pretty severe
impacts on parallelism. Instead, here, we only take the global
write lock if we have to disconnect a peer.
lightning/src/ln/peer_handler.rs