mirror of https://github.com/voidlizard/hbs2
wip, log merging, debug-20
This commit is contained in:
parent
3efe992436
commit
a73c2c4659
|
@ -427,16 +427,22 @@ refChanUpdateProto self pc adapter msg = do
|
||||||
let toWait = TimeoutSec (fromIntegral $ 2 * view refChanHeadWaitAccept headBlock)
|
let toWait = TimeoutSec (fromIntegral $ 2 * view refChanHeadWaitAccept headBlock)
|
||||||
let ttl = ts + fromNanoSecs (fromIntegral $ toNanoSeconds toWait)
|
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)
|
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
|
lift $ gossip msg
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue