diff options
author | Antoine A <> | 2023-10-06 03:58:16 +0200 |
---|---|---|
committer | Antoine A <> | 2023-10-06 03:58:16 +0200 |
commit | c3f80619983e4eb80897c87add51bc70594e4b54 (patch) | |
tree | 5cb0ee4462cadeea7d230041e3dbbdc8936c0718 /eth-wire/src/loops/worker.rs | |
parent | 2e685701559118da856a0cde10849d82a112c9c7 (diff) | |
download | depolymerization-c3f80619983e4eb80897c87add51bc70594e4b54.tar.gz depolymerization-c3f80619983e4eb80897c87add51bc70594e4b54.tar.bz2 depolymerization-c3f80619983e4eb80897c87add51bc70594e4b54.zip |
Clean code
Diffstat (limited to 'eth-wire/src/loops/worker.rs')
-rw-r--r-- | eth-wire/src/loops/worker.rs | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/eth-wire/src/loops/worker.rs b/eth-wire/src/loops/worker.rs index 81eb59c..9139137 100644 --- a/eth-wire/src/loops/worker.rs +++ b/eth-wire/src/loops/worker.rs @@ -199,13 +199,16 @@ fn sync_chain_removed( // Only keep incoming transaction that are not reconfirmed // TODO study risk of accepting only mined transactions for faster recovery - for tx in removed.iter().filter_map(|sync_tx| { - (sync_tx.tx.to == Some(*addr) - && txs - .iter() - .all(|it| it.tx.hash != sync_tx.tx.hash || it.confirmations < min_confirmation)) - .then(|| &sync_tx.tx) - }) { + for tx in removed + .iter() + .filter(|sync_tx| { + sync_tx.tx.to == Some(*addr) + && txs + .iter() + .all(|it| it.tx.hash != sync_tx.tx.hash || it.confirmations < min_confirmation) + }) + .map(|s| &s.tx) + { match InMetadata::decode(&tx.input) { Ok(metadata) => match metadata { InMetadata::Credit { reserve_pub } => { |