idx: u64,
secret: [u8; 32],
},
+ /// Indicates our channel is likely a stale version, we're closing, but this update should
+ /// allow us to spend what is ours if our counterparty broadcasts their latest state.
+ RescueRemoteCommitmentTXInfo {
+ their_current_per_commitment_point: PublicKey,
+ },
}
impl Writeable for ChannelMonitorUpdateStep {
idx.write(w)?;
secret.write(w)?;
},
+ &ChannelMonitorUpdateStep::RescueRemoteCommitmentTXInfo { ref their_current_per_commitment_point } => {
+ 4u8.write(w)?;
+ their_current_per_commitment_point.write(w)?;
+ },
}
Ok(())
}
secret: Readable::read(r)?,
})
},
+ 4u8 => {
+ Ok(ChannelMonitorUpdateStep::RescueRemoteCommitmentTXInfo {
+ their_current_per_commitment_point: Readable::read(r)?,
+ })
+ },
_ => Err(DecodeError::InvalidValue),
}
}
ChannelMonitorUpdateStep::PaymentPreimage { payment_preimage } =>
self.provide_payment_preimage(&PaymentHash(Sha256::hash(&payment_preimage.0[..]).into_inner()), &payment_preimage),
ChannelMonitorUpdateStep::CommitmentSecret { idx, secret } =>
- self.provide_secret(idx, secret)?
+ self.provide_secret(idx, secret)?,
+ ChannelMonitorUpdateStep::RescueRemoteCommitmentTXInfo { their_current_per_commitment_point } =>
+ self.provide_rescue_remote_commitment_tx_info(their_current_per_commitment_point),
}
}
self.latest_update_id = updates.update_id;
ChannelMonitorUpdateStep::PaymentPreimage { payment_preimage } =>
self.provide_payment_preimage(&PaymentHash(Sha256::hash(&payment_preimage.0[..]).into_inner()), &payment_preimage),
ChannelMonitorUpdateStep::CommitmentSecret { idx, secret } =>
- self.provide_secret(idx, secret)?
+ self.provide_secret(idx, secret)?,
+ ChannelMonitorUpdateStep::RescueRemoteCommitmentTXInfo { their_current_per_commitment_point } =>
+ self.provide_rescue_remote_commitment_tx_info(their_current_per_commitment_point),
}
}
self.latest_update_id = updates.update_id;