Enforce option_data_loss_protect user-side
authorAntoine Riard <ariard@student.42.fr>
Wed, 10 Jul 2019 20:39:10 +0000 (16:39 -0400)
committerAntoine Riard <ariard@student.42.fr>
Mon, 5 Aug 2019 19:47:36 +0000 (15:47 -0400)
commitc3991602a589b2c9fa76faff49885544cba048b3
tree902d49d168024ba3af9f14e50d3d892cde07d879
parent2869e50d67ad5fc18b9434c771d7c227ead800ce
Enforce option_data_loss_protect user-side

If we remote peer provide us a revocation secret which doesn't
match with next_remote_revocation_number we close the channel
If we learn that we are fallen-behind, we send back a CloseDelayBroadcast
error, special take care will be take to log error and channel should
stale, i.e we expect our honest peer to unilateral close to claim
on it our balance

Add ChannelError::CloseDelayBroadcast to signal that you need to close
the channel but not to broadcast it while however update ChannelMonitor
with remote per_commitment_point thanks to our peer being a gentleman
src/ln/channel.rs
src/ln/channelmanager.rs
src/ln/channelmonitor.rs