Skip to content

Commit

Permalink
Don't run wait action multiple times in chain seek client
Browse files Browse the repository at this point in the history
  • Loading branch information
jhbertra committed Aug 8, 2022
1 parent 0737318 commit 4d9611a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions marlowe-protocols/src/Network/Protocol/ChainSeek/Client.hs
Expand Up @@ -184,9 +184,9 @@ chainSeekClientPeer initialPoint (ChainSeekClient mclient) =
-> m (ClientStNext query err result point tip m a)
-> Peer (ChainSeek query point tip) 'AsClient ('StNext err result 'StMustReply) m a
peerWait pos query mnext = Effect do
ClientStNext{..} <- mnext
next@ClientStNext{..} <- mnext
pure $ Await (ServerAgency (TokNext query TokMustReply)) \case
MsgRejectQuery err tip -> peerIdle pos $ recvMsgQueryRejected err tip
MsgRollForward result pos' tip -> peerIdle pos' $ recvMsgRollForward result pos' tip
MsgRollBackward pos' tip -> peerIdle pos' $ recvMsgRollBackward pos' tip
MsgPing -> Yield (ClientAgency TokPing) MsgPong $ peerWait pos query mnext
MsgPing -> Yield (ClientAgency TokPing) MsgPong $ peerWait pos query $ pure next

0 comments on commit 4d9611a

Please sign in to comment.