Skip to content

Commit 82cea2f

Browse files
committed
Cancel consensus instances that are not needed anymore.
Signed-off-by: Karolis Petrauskas <karolis.petrauskas@erisata.lt>
1 parent b9aa639 commit 82cea2f

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

packages/chain/node.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -738,6 +738,7 @@ func (cni *chainNodeImpl) handleNeedConsensus(ctx context.Context, upd *chainman
738738
cni.consensusInsts.ForEach(func(cmtAddr cryptolib.AddressKey, cmtInsts *shrinkingmap.ShrinkingMap[cmt_log.LogIndex, *consensusInst]) bool {
739739
cmtInsts.ForEach(func(li cmt_log.LogIndex, ci *consensusInst) bool {
740740
if ci.request != nil && !upd.Has(chainmanager.MakeConsensusKey(ci.request.CommitteeAddr, li)) {
741+
ci.Cancel()
741742
cmtInsts.Delete(li)
742743
}
743744
return true

0 commit comments

Comments
 (0)