@@ -721,9 +721,6 @@ proc getBlocks*[A, B](man: SyncManager[A, B], peer: A,
721721template headAge (): uint64 =
722722 wallSlot - headSlot
723723
724- template peerAge (): uint64 =
725- if peerSlot > wallSlot: 0 'u64 else : wallSlot - peerSlot
726-
727724template queueAge (): uint64 =
728725 wallSlot - man.queue.outSlot
729726
@@ -753,7 +750,7 @@ proc syncStep[A, B](man: SyncManager[A, B], index: int, peer: A) {.async.} =
753750 local_head_slot = headSlot, peer = peer, index = index,
754751 tolerance_value = man.toleranceValue, peer_speed = peer.netKbps (),
755752 peer_score = peer.getScore (), topics = " syncman"
756- let failure = SyncFailure .init (SyncFailureKind .StatusInvalid , peer)
753+ discard SyncFailure .init (SyncFailureKind .StatusInvalid , peer)
757754 return
758755
759756 # Check if we need to update peer's status information
@@ -772,7 +769,7 @@ proc syncStep[A, B](man: SyncManager[A, B], index: int, peer: A) {.async.} =
772769 debug " Failed to get remote peer's status, exiting" , peer = peer,
773770 peer_score = peer.getScore (), peer_head_slot = peerSlot,
774771 peer_speed = peer.netKbps (), index = index, topics = " syncman"
775- let failure = SyncFailure .init (SyncFailureKind .StatusDownload , peer)
772+ discard SyncFailure .init (SyncFailureKind .StatusDownload , peer)
776773 return
777774 except CatchableError as exc:
778775 debug " Unexpected exception while updating peer's status" ,
@@ -826,7 +823,7 @@ proc syncStep[A, B](man: SyncManager[A, B], index: int, peer: A) {.async.} =
826823 debug " Failed to get remote peer's status, exiting" , peer = peer,
827824 peer_score = peer.getScore (), peer_head_slot = peerSlot,
828825 peer_speed = peer.netKbps (), index = index, topics = " syncman"
829- let failure = SyncFailure .init (SyncFailureKind .StatusDownload , peer)
826+ discard SyncFailure .init (SyncFailureKind .StatusDownload , peer)
830827 return
831828 except CatchableError as exc:
832829 debug " Unexpected exception while updating peer's status" ,
@@ -919,7 +916,7 @@ proc syncStep[A, B](man: SyncManager[A, B], index: int, peer: A) {.async.} =
919916 request_step = req.step, peer = peer,
920917 peer_score = peer.getScore (), peer_speed = peer.netKbps (),
921918 index = index, topics = " syncman"
922- let failure = SyncFailure .init (SyncFailureKind .BadResponse , peer)
919+ discard SyncFailure .init (SyncFailureKind .BadResponse , peer)
923920 return
924921
925922 # Scoring will happen in `syncUpdate`.
@@ -933,7 +930,7 @@ proc syncStep[A, B](man: SyncManager[A, B], index: int, peer: A) {.async.} =
933930 request_step = req.step, peer = peer, index = index,
934931 peer_score = peer.getScore (), peer_speed = peer.netKbps (),
935932 topics = " syncman"
936- let failure = SyncFailure .init (SyncFailureKind .BlockDownload , peer)
933+ discard SyncFailure .init (SyncFailureKind .BlockDownload , peer)
937934 return
938935
939936 except CatchableError as exc:
@@ -1054,7 +1051,7 @@ proc syncLoop[A, B](man: SyncManager[A, B]) {.async.} =
10541051 let op1 = man.queue.opcounter
10551052 await sleepAsync (chronos.seconds (pauseTime))
10561053 let op2 = man.queue.opcounter
1057- let (map, sleeping, waiting , pending) = man.getWorkersStats ()
1054+ let (_, _, _ , pending) = man.getWorkersStats ()
10581055 if pending == 0 :
10591056 pauseTime = MinPauseTime
10601057 else :
0 commit comments