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
|
||||
_ -> Nothing
|
||||
|
||||
|
||||
(_, ptran) <- MaybeT $ pure $ unboxSignedBox0 @(ProposeTran e) @e proposed
|
||||
|
||||
debug $ "ACCEPT FROM:" <+> pretty (AsBase58 peerKey) <+> pretty h0
|
||||
|
|
|
@ -217,7 +217,7 @@ refChanWorker env brains = do
|
|||
debug $ "ON ROUND STARTED" <+> pretty rcrk
|
||||
|
||||
forever do
|
||||
pause @'Seconds 60
|
||||
pause @'Seconds 30
|
||||
|
||||
now <- getTimeCoarse
|
||||
xs <- readTVarIO rounds <&> HashSet.toList
|
||||
|
@ -228,10 +228,17 @@ refChanWorker env brains = do
|
|||
se <- MaybeT $ find @e x id
|
||||
|
||||
closed <- readTVarIO (view refChanRoundClosed se)
|
||||
trans <- atomically $ readTVar (view refChanRoundTrans se) <&> HashSet.toList
|
||||
|
||||
let ttl = view refChanRoundTTL se
|
||||
|
||||
when (closed || ttl <= now) do
|
||||
lift $ expire x
|
||||
|
||||
forM_ trans $ \t -> do
|
||||
debug $ "WRITING TRANS" <+> pretty t
|
||||
lift $ refChanWriteTranFn env t
|
||||
|
||||
atomically $ modifyTVar rounds (HashSet.delete x)
|
||||
debug $ "CLEANUP ROUND" <+> pretty x
|
||||
|
||||
|
|
Loading…
Reference in New Issue