mirror of https://github.com/voidlizard/hbs2
wip, log merging, debug-18
This commit is contained in:
parent
9981d457e0
commit
baf0d6e3b6
|
@ -498,6 +498,7 @@ refChanUpdateProto self pc adapter msg = do
|
||||||
Propose _ pbox -> Just pbox
|
Propose _ pbox -> Just pbox
|
||||||
_ -> Nothing
|
_ -> Nothing
|
||||||
|
|
||||||
|
|
||||||
(_, ptran) <- MaybeT $ pure $ unboxSignedBox0 @(ProposeTran e) @e proposed
|
(_, ptran) <- MaybeT $ pure $ unboxSignedBox0 @(ProposeTran e) @e proposed
|
||||||
|
|
||||||
debug $ "ACCEPT FROM:" <+> pretty (AsBase58 peerKey) <+> pretty h0
|
debug $ "ACCEPT FROM:" <+> pretty (AsBase58 peerKey) <+> pretty h0
|
||||||
|
|
|
@ -217,7 +217,7 @@ refChanWorker env brains = do
|
||||||
debug $ "ON ROUND STARTED" <+> pretty rcrk
|
debug $ "ON ROUND STARTED" <+> pretty rcrk
|
||||||
|
|
||||||
forever do
|
forever do
|
||||||
pause @'Seconds 60
|
pause @'Seconds 30
|
||||||
|
|
||||||
now <- getTimeCoarse
|
now <- getTimeCoarse
|
||||||
xs <- readTVarIO rounds <&> HashSet.toList
|
xs <- readTVarIO rounds <&> HashSet.toList
|
||||||
|
@ -228,10 +228,17 @@ refChanWorker env brains = do
|
||||||
se <- MaybeT $ find @e x id
|
se <- MaybeT $ find @e x id
|
||||||
|
|
||||||
closed <- readTVarIO (view refChanRoundClosed se)
|
closed <- readTVarIO (view refChanRoundClosed se)
|
||||||
|
trans <- atomically $ readTVar (view refChanRoundTrans se) <&> HashSet.toList
|
||||||
|
|
||||||
let ttl = view refChanRoundTTL se
|
let ttl = view refChanRoundTTL se
|
||||||
|
|
||||||
when (closed || ttl <= now) do
|
when (closed || ttl <= now) do
|
||||||
lift $ expire x
|
lift $ expire x
|
||||||
|
|
||||||
|
forM_ trans $ \t -> do
|
||||||
|
debug $ "WRITING TRANS" <+> pretty t
|
||||||
|
lift $ refChanWriteTranFn env t
|
||||||
|
|
||||||
atomically $ modifyTVar rounds (HashSet.delete x)
|
atomically $ modifyTVar rounds (HashSet.delete x)
|
||||||
debug $ "CLEANUP ROUND" <+> pretty x
|
debug $ "CLEANUP ROUND" <+> pretty x
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue