diff options
Diffstat (limited to 'core/syncer/consensus.go')
-rw-r--r-- | core/syncer/consensus.go | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/core/syncer/consensus.go b/core/syncer/consensus.go index d334bbd..8852a47 100644 --- a/core/syncer/consensus.go +++ b/core/syncer/consensus.go @@ -623,10 +623,13 @@ func (con *Consensus) resizeByNumChains(numChains uint32) { // Resize the pool of blocks. con.blocks = append(con.blocks, types.ByPosition{}) // Resize agreement modules. - a := newAgreement(con.receiveChan, con.pullChan, con.nodeSetCache, - &con.agreementWaitGroup, con.logger) + a := newAgreement(con.receiveChan, con.pullChan, con.nodeSetCache, con.logger) con.agreements = append(con.agreements, a) - go a.run() + con.agreementWaitGroup.Add(1) + go func() { + defer con.agreementWaitGroup.Done() + a.run() + }() } } } |