Make get_latest_local_commitment_txn public
authorAntoine Riard <ariard@student.42.fr>
Thu, 1 Aug 2019 14:54:02 +0000 (10:54 -0400)
committerAntoine Riard <ariard@student.42.fr>
Mon, 5 Aug 2019 19:47:37 +0000 (15:47 -0400)
commit2322c2365c0bb91ce7440b9971a0bc43f1bd4dc8
treec26b9b48f0b578e171d499714a682c7d5b041bd7
parentc3991602a589b2c9fa76faff49885544cba048b3
Make get_latest_local_commitment_txn public

You may use it to get a broadcastable local toxic tx in case of fallen-behind,
i.e when receiving a channel_reestablish with a proof that our remote side
knows a higher revocation secret than the local commitment number we are aware
of. Broadcasting these transactions are UNSAFE, as they allow remote side to punish
you. Nevertheless you may want to broadcast them if remote don't close channel with his
higher commitment transaction after a substantial amount of time (a month or even a year)
to get back funds. Best may be to contact out-of-band the other node operator to coordinate
with him if option is available to you. In any-case, choice is up to the user.

Also, log toxic commitment tx id in channel_reestablish sending back
ChannelError::CloseDelayBroadcast
src/ln/channelmanager.rs
src/ln/channelmonitor.rs