Avoid redundant broadcast of local commitment transaction
authorWilmer Paulino <wilmer.paulino@gmail.com>
Tue, 13 Dec 2022 03:00:06 +0000 (19:00 -0800)
committerWilmer Paulino <wilmer.paulino@gmail.com>
Fri, 16 Dec 2022 19:54:26 +0000 (11:54 -0800)
commitff48f5df4dd74720602afc85dcda49724123758c
treee39e6fb9516ac032f21a43bbfdd7e0edd7c5cedc
parent56afbf50642db5325cbbf1ccd50ff985ea44d77b
Avoid redundant broadcast of local commitment transaction

This change follows the rationale of commit 62236c7 and addresses the
last remaining redundant local commitment broadcast.

There's no need to broadcast our local commitment transaction if we've
already seen a confirmed one as it'll be immediately rejected as a
duplicate/conflict.

This will also help prevent dispatching spurious events for bumping
commitment and HTLC transactions through anchor outputs since the
dispatch for said events follows the same flow as our usual commitment
broadcast.
lightning/src/chain/channelmonitor.rs
lightning/src/ln/functional_tests.rs
lightning/src/ln/monitor_tests.rs
lightning/src/ln/payment_tests.rs
lightning/src/ln/reorg_tests.rs