]> git.bitcoin.ninja Git - rust-lightning/commit
Avoid unnecessarily cloning unsigned Transaction when broadcasting 2023-09-one-less-clone
authorMatt Corallo <git@bluematt.me>
Fri, 15 Sep 2023 19:17:34 +0000 (19:17 +0000)
committerMatt Corallo <git@bluematt.me>
Fri, 15 Sep 2023 20:41:48 +0000 (20:41 +0000)
commit53c8f89ba9c0506fb138f57ffa5d0754be4b238c
tree7fb07439a5cdcd93f721f8c2fb600b58730b8c77
parent9850c5814abdf69883b51a4afe73912ff5436fd9
Avoid unnecessarily cloning unsigned Transaction when broadcasting

Our `Trusted*` wrappers in `chan_utils` expose additional inner
fields by reference. However, because they were not explicitly
marked as returning a reference with the wrapped struct's
lifetimes, rustc was considering them to return a reference with
the wrapper struct's lifetime.

This is unnecessarily restrictive, and resulted in the addition of
a clone in 9850c5814abdf69883b51a4afe73912ff5436fd9 which we remove
here.
lightning/src/chain/onchaintx.rs
lightning/src/ln/chan_utils.rs