]> git.bitcoin.ninja Git - rust-lightning/commit
Don't return `channel_state` from `decode_update_add_htlc_onion`
authorViktor Tigerström <11711198+ViktorTigerstrom@users.noreply.github.com>
Sat, 23 Jul 2022 22:10:48 +0000 (00:10 +0200)
committerViktor Tigerström <11711198+ViktorTigerstrom@users.noreply.github.com>
Tue, 2 Aug 2022 21:16:17 +0000 (23:16 +0200)
commit65e6fb746735aa71f912eca0b65015313e2e6c1b
treea21ffac94390914fb9f73aef1c6e38a612cf958f
parent4905df889498ec520932ea6684b0ffabbd226641
Don't return `channel_state` from `decode_update_add_htlc_onion`

Currently `decode_update_add_htlc_onion` returns the `channel_state`
lock to ensure that `internal_update_add_htlc` holds a single
`channel_state` lock in when the entire function execution. This is
unnecessary, and since we are moving the channel storage to the
`per_peer_state`, this no longer achieves the goal it was intended for.

We therefore avoid returning the `channel_state` from
`decode_update_add_htlc_onion`, and just retake the lock in
`internal_update_add_htlc` instead.
lightning/src/ln/channelmanager.rs