wip, tryin to fetch refchan head

This commit is contained in:
Dmitry Zuikov 2023-07-15 07:09:31 +03:00
parent 0e1959dfe5
commit 2d5406cee0
1 changed files with 6 additions and 1 deletions

View File

@ -88,7 +88,12 @@ checkDownloaded :: forall m . (MonadIO m, HasStorage m, Block ByteString ~ ByteS
checkDownloaded hr = do
sto <- getStorage
let readBlock h = liftIO $ getBlock sto h
result <- runExceptT $ deepScan ScanDeep (const $ throwError DataNotReady) (fromHashRef hr) readBlock dontHandle
result <- runExceptT $
deepScan ScanDeep (const $ throwError DataNotReady) (fromHashRef hr) readBlock $ \ha -> do
here <- liftIO $ hasBlock sto ha <&> isJust
unless here $ throwError DataNotReady
pure $ either (const False) (const True) result