summaryrefslogtreecommitdiff
path: root/eth-wire
diff options
context:
space:
mode:
authorAntoine A <>2022-02-23 17:43:50 +0100
committerAntoine A <>2022-02-23 17:43:50 +0100
commitd2a167cd660f3beae6dc4515b85a71bff9383f5d (patch)
treee158d54e1f478924a320bfaf59fdb01bdc0b60b6 /eth-wire
parent6ac06e7f52a197e2b46e08adc9c129076af3158d (diff)
downloaddepolymerization-d2a167cd660f3beae6dc4515b85a71bff9383f5d.tar.gz
depolymerization-d2a167cd660f3beae6dc4515b85a71bff9383f5d.tar.bz2
depolymerization-d2a167cd660f3beae6dc4515b85a71bff9383f5d.zip
Clean tests
Diffstat (limited to 'eth-wire')
-rw-r--r--eth-wire/src/loops/worker.rs4
1 files changed, 4 insertions, 0 deletions
diff --git a/eth-wire/src/loops/worker.rs b/eth-wire/src/loops/worker.rs
index aba082e..c6864c2 100644
--- a/eth-wire/src/loops/worker.rs
+++ b/eth-wire/src/loops/worker.rs
@@ -105,6 +105,10 @@ pub fn worker(mut rpc: AutoRpcWallet, mut db: AutoReconnectDb, state: &WireState
if let Err(e) = result {
error!("worker: {}", e);
+ // When we catch an error, we sometimes want to retry immediately (eg. reconnect to RPC or DB).
+ // Rpc error codes are generic. We need to match the msg to get precise ones. Some errors
+ // can resolve themselves when a new block is mined (new fees, new transactions). Our simple
+ // approach is to wait for the next loop when an RPC error is caught to prevent endless logged errors.
skip_notification = !matches!(
e,
LoopError::RPC(rpc::Error::RPC { .. }) | LoopError::Concurrency