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

add delay between xmr auto-funding reattempts #733

Merged
Changes from 1 commit
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 src/farcasterd/trade_state_machine.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1137,6 +1137,7 @@ fn attempt_transition_to_end(
break;
} else {
warn!("{} | Auto-funding Monero transaction failed with {}, retrying, {} retries left", &swap_id.bright_blue_italic(), err, retries);
tokio::time::sleep(std::time::Duration::from_secs(retries)).await;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I fear this introduces too much of a delay. In the worst case, it blocks the entire daemon for 55 seconds. If you really need this, I would at the least lower this to either 10's or 100's of ms.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the worst case, it blocks the entire daemon for 55 seconds.

Don't exaggerate: it's only 45! :P

Reduced to 10ms increments in 82764f4, so upper bound 450 ms. If this catches most failures within the first two retries, let's cut by another order of magnitude.

}
}
}
Expand Down