diff options
author | haoping-ku <haoping.ku@dexon.org> | 2018-11-29 14:30:02 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-11-29 14:30:02 +0800 |
commit | daf3bab93c323b173345811adc9a334dad4a7094 (patch) | |
tree | 8a3957ec1f77262ce92c56f0384b0dedc307628c /core/test/stopper.go | |
parent | 8470ac070f097b261fddc42991a4d2e9ec998db6 (diff) | |
download | tangerine-consensus-daf3bab93c323b173345811adc9a334dad4a7094.tar tangerine-consensus-daf3bab93c323b173345811adc9a334dad4a7094.tar.gz tangerine-consensus-daf3bab93c323b173345811adc9a334dad4a7094.tar.bz2 tangerine-consensus-daf3bab93c323b173345811adc9a334dad4a7094.tar.lz tangerine-consensus-daf3bab93c323b173345811adc9a334dad4a7094.tar.xz tangerine-consensus-daf3bab93c323b173345811adc9a334dad4a7094.tar.zst tangerine-consensus-daf3bab93c323b173345811adc9a334dad4a7094.zip |
core: syncer: add syncer (#346)
Diffstat (limited to 'core/test/stopper.go')
-rw-r--r-- | core/test/stopper.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/core/test/stopper.go b/core/test/stopper.go index abc93c3..40868d8 100644 --- a/core/test/stopper.go +++ b/core/test/stopper.go @@ -61,7 +61,7 @@ func (s *StopByConfirmedBlocks) ShouldStop(nID types.NodeID) bool { lastChecked := s.lastCheckDelivered[nID] currentConfirmedBlocks := s.confirmedBlocks[nID] db := s.dbs[nID] - s.apps[nID].Check(func(app *App) { + s.apps[nID].WithLock(func(app *App) { for _, h := range app.DeliverSequence[lastChecked:] { b, err := db.Get(h) if err != nil { @@ -116,7 +116,7 @@ func (s *StopByRound) ShouldStop(nID types.NodeID) bool { if curRound := s.currentRounds[nID]; curRound < s.untilRound { lastChecked := s.lastCheckDelivered[nID] db := s.dbs[nID] - s.apps[nID].Check(func(app *App) { + s.apps[nID].WithLock(func(app *App) { for _, h := range app.DeliverSequence[lastChecked:] { b, err := db.Get(h) if err != nil { |