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

[r2r] Better error message for failing swaps due to a time difference between maker and taker #1677

Merged
merged 2 commits into from
Feb 24, 2023
Merged
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
4 changes: 4 additions & 0 deletions dev-logs/2023-feb/fixes/fix_swap_time_difference_err_message
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Changed the error message for failing swaps due to a time difference between maker and taker to a more informative one


author: @shamardy <shamardy@gmail.com>
2 changes: 1 addition & 1 deletion mm2src/mm2_main/src/lp_swap/maker_swap.rs
Original file line number Diff line number Diff line change
Expand Up @@ -597,7 +597,7 @@ impl MakerSwap {
if time_dif > 60 {
self.broadcast_negotiated_false();
return Ok((Some(MakerSwapCommand::Finish), vec![MakerSwapEvent::NegotiateFailed(
ERRL!("Started_at time_dif over 60 {}", time_dif).into(),
ERRL!("The time difference between you and the taker cannot be longer than 60 seconds. Current difference: {}. Please make sure that your system clock is synced to the correct time before starting another swap!", time_dif).into(),
)]));
}

Expand Down
2 changes: 1 addition & 1 deletion mm2src/mm2_main/src/lp_swap/taker_swap.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1053,7 +1053,7 @@ impl TakerSwap {
let time_dif = self.r().data.started_at.abs_diff(maker_data.started_at());
if time_dif > 60 {
return Ok((Some(TakerSwapCommand::Finish), vec![TakerSwapEvent::NegotiateFailed(
ERRL!("Started_at time_dif over 60 {}", time_dif).into(),
ERRL!("The time difference between you and the maker cannot be longer than 60 seconds. Current difference: {}. Please make sure that your system clock is synced to the correct time before starting another swap!", time_dif).into(),
)]));
}

Expand Down