mirror of https://github.com/voidlizard/hbs2
wip, tryin to fetch refchan head
This commit is contained in:
parent
0e1959dfe5
commit
2d5406cee0
|
@ -88,7 +88,12 @@ checkDownloaded :: forall m . (MonadIO m, HasStorage m, Block ByteString ~ ByteS
|
||||||
checkDownloaded hr = do
|
checkDownloaded hr = do
|
||||||
sto <- getStorage
|
sto <- getStorage
|
||||||
let readBlock h = liftIO $ getBlock sto h
|
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
|
pure $ either (const False) (const True) result
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue