mirror of https://github.com/voidlizard/hbs2
wip
This commit is contained in:
parent
8492b41087
commit
717f24deab
|
@ -333,11 +333,12 @@ instance ( HasProtocol e p
|
||||||
thatPeer _ = asks (view answTo)
|
thatPeer _ = asks (view answTo)
|
||||||
|
|
||||||
deferred _ action = do
|
deferred _ action = do
|
||||||
|
me <- lift $ ownPeer @e
|
||||||
who <- asks (view answTo)
|
who <- asks (view answTo)
|
||||||
fab <- lift $ getFabriq @e
|
fab <- lift $ getFabriq @e
|
||||||
pip <- lift $ asks (view envDeferred)
|
pip <- lift $ asks (view envDeferred)
|
||||||
ss <- lift getStorage
|
ss <- lift getStorage
|
||||||
liftIO $ addJob pip $ runPeerM ss fab who (runResponseM who action)
|
liftIO $ addJob pip $ runPeerM ss fab me (runResponseM who action)
|
||||||
|
|
||||||
response msg = do
|
response msg = do
|
||||||
let proto = protoId @e @p (Proxy @p)
|
let proto = protoId @e @p (Proxy @p)
|
||||||
|
|
|
@ -93,7 +93,6 @@ type instance SessionData e (BlockChunks e) = BlockDownload
|
||||||
newtype instance SessionKey e (BlockChunks e) =
|
newtype instance SessionKey e (BlockChunks e) =
|
||||||
DownloadSessionKey (Peer e, Cookie e)
|
DownloadSessionKey (Peer e, Cookie e)
|
||||||
deriving stock (Generic,Typeable)
|
deriving stock (Generic,Typeable)
|
||||||
deriving newtype (Hashable)
|
|
||||||
|
|
||||||
newtype BlockSizeSession e =
|
newtype BlockSizeSession e =
|
||||||
BlockSizeSession
|
BlockSizeSession
|
||||||
|
@ -259,6 +258,7 @@ mkAdapter cww = do
|
||||||
when ( h1 == h ) $ do
|
when ( h1 == h ) $ do
|
||||||
liftIO $ commitBlock cww cKey h
|
liftIO $ commitBlock cww cKey h
|
||||||
expire cKey
|
expire cKey
|
||||||
|
debug $ "BLOCK IS READY" <+> pretty h
|
||||||
-- FIXME: return this event!
|
-- FIXME: return this event!
|
||||||
-- lift $ runEngineM env $ emitBlockReadyEvent ev h -- TODO: fix this crazy shit
|
-- lift $ runEngineM env $ emitBlockReadyEvent ev h -- TODO: fix this crazy shit
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue