diff --git a/hbs2-peer/app/BlockDownload.hs b/hbs2-peer/app/BlockDownload.hs index 37651e0b..e7c08360 100644 --- a/hbs2-peer/app/BlockDownload.hs +++ b/hbs2-peer/app/BlockDownload.hs @@ -350,7 +350,7 @@ blockDownloadLoop env0 = do -- UPDATE-STATS-LOOP void $ ContT $ withAsync $ updateRates e rates nonces - replicateM_ downT $ ContT $ withAsync do + void $ ContT $ withAsync do forever do pause @'Seconds 120 atomically do @@ -638,6 +638,10 @@ blockDownloadLoop env0 = do S.yield =<< liftIO (readTVarIO sizeReq <&> ("sizeReq",) . fromIntegral . HashMap.size) S.yield =<< liftIO (readTVarIO seen <&> ("seen",) . fromIntegral . HashMap.size) + b <- liftIO (readTVarIO busy) <&> HM.elems + let reallyBusy = sum [ 1 | v <- b, v > 0 ] + S.yield ("reallyBusy", reallyBusy) + forever do withPeerM e $ withDownload env0 do pause @'Seconds 5