clean up and improvements

This commit is contained in:
Diva M
2022-12-23 09:52:10 -05:00
parent 3643f5cc19
commit 66f9aa922d
2 changed files with 36 additions and 59 deletions

View File

@@ -278,11 +278,9 @@ impl<T: BeaconChainTypes> SyncNetworkContext<T> {
is_stream_terminator: bool,
) -> Option<(ChainId, BatchId)> {
if is_stream_terminator {
self.range_requests
.remove(&request_id)
.map(|(chain_id, batch_id)| (chain_id, batch_id))
self.range_requests.remove(&request_id)
} else {
self.range_requests.get(&request_id).cloned()
self.range_requests.get(&request_id).copied()
}
}
@@ -354,7 +352,7 @@ impl<T: BeaconChainTypes> SyncNetworkContext<T> {
.remove(&request_id)
.map(|batch_id| batch_id)
} else {
self.backfill_requests.get(&request_id).cloned()
self.backfill_requests.get(&request_id).copied()
}
}