Skip to content

Commit 9a901f3

Browse files
fix(substrate/client): cast MAJOR_SYNC_BLOCKS to usize (#8094)
Rustc started complaining from some versions onward when calling `into` on `MAJOR_SYNC_BLOCKS`. Not sure what's the version from which it fails, but it does. I'm on 1.85.1, it did fail on 1.82 as well. --------- Co-authored-by: Iulian Barbu <[email protected]>
1 parent 4da7509 commit 9a901f3

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

substrate/client/network/sync/src/strategy/chain_sync.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1023,7 +1023,7 @@ where
10231023
// If there are more than `MAJOR_SYNC_BLOCKS` in the import queue then we have
10241024
// enough to do in the import queue that it's not worth kicking off
10251025
// an ancestor search, which is what we do in the next match case below.
1026-
if self.queue_blocks.len() > MAJOR_SYNC_BLOCKS.into() {
1026+
if self.queue_blocks.len() > MAJOR_SYNC_BLOCKS as usize {
10271027
debug!(
10281028
target: LOG_TARGET,
10291029
"New peer {} with unknown best hash {} ({}), assuming common block.",
@@ -1839,7 +1839,7 @@ where
18391839
MAX_BLOCKS_TO_LOOK_BACKWARDS.into() &&
18401840
best_queued < peer.best_number &&
18411841
peer.common_number < last_finalized &&
1842-
queue_blocks.len() <= MAJOR_SYNC_BLOCKS.into()
1842+
queue_blocks.len() <= MAJOR_SYNC_BLOCKS as usize
18431843
{
18441844
trace!(
18451845
target: LOG_TARGET,

0 commit comments

Comments
 (0)