refactor: use set_lookahead in set_lookahead_for_all

This commit is contained in:
Vladimir Fomene 2023-08-29 21:06:08 +03:00
parent 2867e88b64
commit e89cf5a16a
No known key found for this signature in database
GPG Key ID: 4D8AB1DF0F7BFBC3

View File

@ -192,8 +192,7 @@ impl<K: Clone + Ord + Debug> KeychainTxOutIndex<K> {
/// [`set_lookahead`]: Self::set_lookahead
pub fn set_lookahead_for_all(&mut self, lookahead: u32) {
for keychain in &self.keychains.keys().cloned().collect::<Vec<_>>() {
self.lookahead.insert(keychain.clone(), lookahead);
self.replenish_lookahead(keychain);
self.set_lookahead(keychain, lookahead);
}
}