Skip to content

Commit

Permalink
fix: Add timestamp to make RenewRevoke message unique.
Browse files Browse the repository at this point in the history
  • Loading branch information
holzeis committed Feb 3, 2024
1 parent 0786724 commit 1d68647
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions dlc-manager/src/channel_updater.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
5 changes: 4 additions & 1 deletion dlc-messages/src/channel.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)]
Expand Down

0 comments on commit 1d68647

Please sign in to comment.