mirror of https://github.com/voidlizard/hbs2
wip, log merging, debug-23
This commit is contained in:
parent
308a0ce833
commit
29d12e7b4d
|
@ -382,7 +382,7 @@ refChanUpdateProto self pc adapter msg = do
|
|||
guard =<< lift (refChanSubscribed adapter (getRefChanId msg))
|
||||
|
||||
let h0 = hashObject @HbSync (serialise msg)
|
||||
guard =<< liftIO (hasBlock sto h0 <&> isNothing)
|
||||
-- guard =<< liftIO (hasBlock sto h0 <&> isNothing)
|
||||
|
||||
case msg of
|
||||
Propose chan box -> do
|
||||
|
@ -467,7 +467,6 @@ refChanUpdateProto self pc adapter msg = do
|
|||
lift $ gossip accept
|
||||
|
||||
-- -- рассылаем ли себе? что бы был хоть один accept
|
||||
liftIO $ putBlock sto (serialise accept)
|
||||
lift $ refChanUpdateProto True pc adapter accept
|
||||
|
||||
Accept chan box -> deferred proto do
|
||||
|
@ -525,7 +524,7 @@ refChanUpdateProto self pc adapter msg = do
|
|||
ha <- MaybeT $ liftIO $ putBlock sto (serialise msg)
|
||||
|
||||
atomically $ modifyTVar (view refChanRoundTrans rcRound) (HashSet.insert (HashRef ha))
|
||||
atomically $ modifyTVar (view refChanRoundTrans rcRound) (HashSet.insert hashRef) -- propose just in case we missed it?
|
||||
-- atomically $ modifyTVar (view refChanRoundTrans rcRound) (HashSet.insert hashRef) -- propose just in case we missed it?
|
||||
|
||||
accepts <- atomically $ readTVar (view refChanRoundAccepts rcRound) <&> HashMap.size
|
||||
|
||||
|
|
|
@ -512,7 +512,7 @@ logMergeProcess _ q = do
|
|||
forM_ new $ \tnew -> do
|
||||
debug $ "TRANS TO MERGE" <+> pretty tnew
|
||||
|
||||
let merged = (current <> HashSet.fromList new) & HashSet.toList
|
||||
let merged = HashSet.fromList new & HashSet.toList
|
||||
|
||||
let pt = toPTree (MaxSize 256) (MaxNum 256) merged
|
||||
|
||||
|
|
Loading…
Reference in New Issue