mirror of https://github.com/voidlizard/hbs2
wip
This commit is contained in:
parent
1211c2f050
commit
5f54c95c89
|
@ -702,15 +702,17 @@ peerDownloadLoop peer = do
|
||||||
Cache.purgeExpired sizeCache
|
Cache.purgeExpired sizeCache
|
||||||
Cache.purgeExpired noBlock
|
Cache.purgeExpired noBlock
|
||||||
|
|
||||||
auth' <- lift $ find (KnownPeerKey peer) id
|
|
||||||
pinfo' <- lift $ find (PeerInfoKey peer) id -- (view peerDownloadFail)
|
|
||||||
|
|
||||||
let mbauth = (,) <$> auth' <*> pinfo'
|
npi <- newPeerInfo
|
||||||
|
|
||||||
|
auth' <- lift $ find (KnownPeerKey peer) id
|
||||||
|
pinfo <- lift $ fetch True npi (PeerInfoKey peer) id
|
||||||
|
|
||||||
|
let mbauth = (,) <$> auth' <*> pure pinfo
|
||||||
|
|
||||||
let noAuth = do
|
let noAuth = do
|
||||||
let authNone = isNothing auth'
|
let authNone = if isNothing auth' then "noauth" else ""
|
||||||
let pingNone = isNothing pinfo'
|
warn ( "lost peer auth" <+> pretty peer <+> pretty authNone )
|
||||||
warn ( "lost peer auth" <+> pretty peer <+> pretty authNone <+> pretty pingNone )
|
|
||||||
pause @'Seconds 1
|
pause @'Seconds 1
|
||||||
-- liftIO $ withPeerM pe $ sendPing @e peer
|
-- liftIO $ withPeerM pe $ sendPing @e peer
|
||||||
-- -- FIXME: time-hardcode
|
-- -- FIXME: time-hardcode
|
||||||
|
@ -719,7 +721,7 @@ peerDownloadLoop peer = do
|
||||||
-- unless found do
|
-- unless found do
|
||||||
-- warn ( "peer lost. stopping peer loop" <+> pretty peer )
|
-- warn ( "peer lost. stopping peer loop" <+> pretty peer )
|
||||||
|
|
||||||
maybe1 mbauth noAuth $ \(_,pinfo) -> do
|
maybe1 mbauth noAuth $ \_ -> do
|
||||||
|
|
||||||
withBlockForDownload peer $ \h -> do
|
withBlockForDownload peer $ \h -> do
|
||||||
-- TODO: insert-busyloop-counter-for-block-request
|
-- TODO: insert-busyloop-counter-for-block-request
|
||||||
|
|
Loading…
Reference in New Issue