-
Notifications
You must be signed in to change notification settings - Fork 116
Fix wait_for_tx/outpoint exponential backoff #641
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
Conversation
👋 Thanks for assigning @tnull as a reviewer! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! Seems like wait_for_outpoint_spend
might benefit from the same fix?
} | ||
|
||
pub(crate) fn wait_for_tx<E: ElectrumApi>(electrs: &E, txid: Txid) { | ||
let mut tx_res = electrs.transaction_get(&txid); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe it's worth to keep the pattern to avoid the unnecessary ping if the result is immediately available.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok. What is the ping for actually?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See https://docs.rs/electrum-client/latest/electrum_client/trait.ElectrumApi.html#tymethod.ping
ping
might trigger electrs
to process new data before we actually attempt the lookup.
Backoff wasn't actually working and polling would happen without any delay at all.
0234637
to
3df1477
Compare
🔔 1st Reminder Hey @tnull! This PR has been waiting for your review. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Backoff wasn't actually working and polling would happen without any delay at all.