Skip to content

Commit 3d70262

Browse files
committed
Drop immediate-retry logic
It's not super clear that it achieves much in the face of a rate-limited Esplora server, and having a custom sleep there is just awkward. So we drop it and hope we still get a chance to sync our on-chain wallet now and then.
1 parent 6b1ada6 commit 3d70262

File tree

1 file changed

+2
-12
lines changed

1 file changed

+2
-12
lines changed

src/wallet.rs

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ use bitcoin::{ScriptBuf, Transaction, TxOut, Txid};
3636
use std::mem;
3737
use std::ops::{Deref, DerefMut};
3838
use std::sync::{Arc, Mutex, RwLock};
39-
use std::time::Duration;
4039

4140
enum WalletSyncStatus {
4241
Completed,
@@ -113,21 +112,12 @@ where
113112
Err(e) => match e {
114113
bdk::Error::Esplora(ref be) => match **be {
115114
bdk::blockchain::esplora::EsploraError::Reqwest(_) => {
116-
// Drop lock, sleep for a second, retry.
117-
drop(wallet_lock);
118-
tokio::time::sleep(Duration::from_secs(1)).await;
119115
log_error!(
120116
self.logger,
121-
"Sync failed due to HTTP connection error, retrying: {}",
117+
"Sync failed due to HTTP connection error: {}",
122118
e
123119
);
124-
let sync_options = SyncOptions { progress: None };
125-
self.inner
126-
.lock()
127-
.unwrap()
128-
.sync(&self.blockchain, sync_options)
129-
.await
130-
.map_err(|e| From::from(e))
120+
Err(From::from(e))
131121
},
132122
_ => {
133123
log_error!(self.logger, "Sync failed due to Esplora error: {}", e);

0 commit comments

Comments
 (0)