]> git.bitcoin.ninja Git - rust-lightning/commit
Test for extra locks held in `handle_error` unconditionally
authorMatt Corallo <git@bluematt.me>
Thu, 6 Apr 2023 02:35:37 +0000 (02:35 +0000)
committerMatt Corallo <git@bluematt.me>
Thu, 6 Apr 2023 03:25:16 +0000 (03:25 +0000)
commit2e39e08c0566f2d2bf74c436baffa72ee69b571e
tree650bedc68ac3b47762aaac5033386f9b75b71986
parent8fcbe641286831c3678b073f9fd2a914829d8cd5
Test for extra locks held in `handle_error` unconditionally

`handle_error` must be called without `per_peer_state` mutex or
`pending_events` mutex locks held or we may risk deadlocks.
Previously we checked this in debug builds in the error path, but
not in the success path.

As it turns out, `funding_transaction_generated`'s error path does
hold a `per_peer_state` lock, which we fix here as well as move the
tests to happen unconditionally.
lightning/src/ln/channelmanager.rs