]> git.bitcoin.ninja Git - rust-lightning/commit
Do not lock while looping htlcs_to_fail
authorTobin C. Harding <me@tobin.cc>
Tue, 29 Nov 2022 01:24:12 +0000 (12:24 +1100)
committerTobin C. Harding <me@tobin.cc>
Thu, 1 Dec 2022 02:32:36 +0000 (13:32 +1100)
commit1dd3184805d7e3ed552ea9ad0b2fd9d06fe23eac
tree41668d0efa7081414b5174dd992ed27fcd1ac959
parentc21378fa479c9f4cb7e06f400baf861625bea475
Do not lock while looping htlcs_to_fail

Currently we loop over `htlcs_to_fail` locking `channel_state` for each
element only to call `get_htlc_inbound_temp_fail_err_and_data` with the
same inputs on each iteration. This is unnecessary, we can refactor and
call `get_htlc_inbound_temp_fail_err_and_data` outside of the loop.
lightning/src/ln/channelmanager.rs