Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Add timestamp to make RenewRevoke message unique. #201

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading