Skip to content

Commit fd4b33f

Browse files
committed
Drop immediate-retry logic in wallet
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 e3279d7 commit fd4b33f

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
@@ -35,7 +35,6 @@ use bitcoin::{ScriptBuf, Transaction, TxOut, Txid};
3535

3636
use std::ops::{Deref, DerefMut};
3737
use std::sync::{Arc, Mutex, RwLock};
38-
use std::time::Duration;
3938

4039
enum WalletSyncStatus {
4140
Completed,
@@ -111,21 +110,12 @@ where
111110
Err(e) => match e {
112111
bdk::Error::Esplora(ref be) => match **be {
113112
bdk::blockchain::esplora::EsploraError::Reqwest(_) => {
114-
// Drop lock, sleep for a second, retry.
115-
drop(wallet_lock);
116-
tokio::time::sleep(Duration::from_secs(1)).await;
117113
log_error!(
118114
self.logger,
119-
"Sync failed due to HTTP connection error, retrying: {}",
115+
"Sync failed due to HTTP connection error: {}",
120116
e
121117
);
122-
let sync_options = SyncOptions { progress: None };
123-
self.inner
124-
.lock()
125-
.unwrap()
126-
.sync(&self.blockchain, sync_options)
127-
.await
128-
.map_err(From::from)
118+
Err(From::from(e))
129119
},
130120
_ => {
131121
log_error!(self.logger, "Sync failed due to Esplora error: {}", e);

0 commit comments

Comments
 (0)