From 1d68647853ff27a6132f649777adb0318054c09e Mon Sep 17 00:00:00 2001 From: Richard Holzeis Date: Sat, 3 Feb 2024 13:44:41 +0100 Subject: [PATCH] fix: Add timestamp to make `RenewRevoke` message unique. --- dlc-manager/src/channel_updater.rs | 1 + dlc-messages/src/channel.rs | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/dlc-manager/src/channel_updater.rs b/dlc-manager/src/channel_updater.rs index b17ea46b..48b52786 100644 --- a/dlc-manager/src/channel_updater.rs +++ b/dlc-manager/src/channel_updater.rs @@ -2092,6 +2092,7 @@ where let msg = RenewRevoke { channel_id: signed_channel.channel_id, per_update_secret: prev_per_update_secret, + timestamp: get_unix_time_now() }; Ok(msg) diff --git a/dlc-messages/src/channel.rs b/dlc-messages/src/channel.rs index 4a664dc4..58212051 100644 --- a/dlc-messages/src/channel.rs +++ b/dlc-messages/src/channel.rs @@ -530,11 +530,14 @@ pub struct RenewRevoke { /// The pre image of the per update point used by the sending party to setup /// the previous channel state. pub per_update_secret: SecretKey, + /// The timestamp when the message was created + pub timestamp: u64, } impl_dlc_writeable!(RenewRevoke, { (channel_id, writeable), - (per_update_secret, writeable) + (per_update_secret, writeable), + (timestamp, writeable) }); #[derive(Clone, Debug, PartialEq, Eq)]