wip, log merging, debug-20

This commit is contained in:
Dmitry Zuikov 2023-07-19 20:52:13 +03:00
parent 3efe992436
commit a73c2c4659
1 changed files with 13 additions and 7 deletions

View File

@ -427,16 +427,22 @@ refChanUpdateProto self pc adapter msg = do
let toWait = TimeoutSec (fromIntegral $ 2 * view refChanHeadWaitAccept headBlock)
let ttl = ts + fromNanoSecs (fromIntegral $ toNanoSeconds toWait)
defRound <- RefChanRound @e (HashRef hash) refchanKey ttl
<$> newTVarIO False
<*> newTVarIO Nothing
<*> newTVarIO (HashSet.singleton (HashRef hash)) -- save propose
<*> newTVarIO (HashMap.singleton peerKey ())
let rcrk = RefChanRoundKey (HashRef hash)
void $ lift $ update defRound rcrk id
lift $ emit @e RefChanRoundEventKey (RefChanRoundEvent rcrk)
rndHere <- lift $ find rcrk id
unless (isJust rndHere) do
defRound <- RefChanRound @e (HashRef hash) refchanKey ttl
<$> newTVarIO False
<*> newTVarIO Nothing
<*> newTVarIO (HashSet.singleton (HashRef hash)) -- save propose
<*> newTVarIO (HashMap.singleton peerKey ())
lift $ update defRound rcrk id
lift $ emit @e RefChanRoundEventKey (RefChanRoundEvent rcrk)
lift $ gossip msg