wip, log merging, debug-18

This commit is contained in:
Dmitry Zuikov 2023-07-19 20:31:33 +03:00
parent 9981d457e0
commit baf0d6e3b6
2 changed files with 9 additions and 1 deletions

View File

@ -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

View File

@ -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