diff options
author | Mission Liao <mission.liao@dexon.org> | 2018-12-18 15:38:51 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-12-18 15:38:51 +0800 |
commit | 9f240d93507cdf03935ba7e4e3a7b226f150736d (patch) | |
tree | 3234b308e164aec346e6127be18060fc641867fd /integration_test | |
parent | ff845cd0bddcaacb8d88da9296af22a45fef1dff (diff) | |
download | dexon-consensus-9f240d93507cdf03935ba7e4e3a7b226f150736d.tar dexon-consensus-9f240d93507cdf03935ba7e4e3a7b226f150736d.tar.gz dexon-consensus-9f240d93507cdf03935ba7e4e3a7b226f150736d.tar.bz2 dexon-consensus-9f240d93507cdf03935ba7e4e3a7b226f150736d.tar.lz dexon-consensus-9f240d93507cdf03935ba7e4e3a7b226f150736d.tar.xz dexon-consensus-9f240d93507cdf03935ba7e4e3a7b226f150736d.tar.zst dexon-consensus-9f240d93507cdf03935ba7e4e3a7b226f150736d.zip |
syncer: fix stuffs (#373)
* Add a new method: GetSyncedConsensus
This method avoids calling BlockDelivered
in SyncBlocks methods, which avoid potential
deadlock.
* Add a method to stop the syncer before synced
* Enable nonBlockingApp for synced Consensus
instance.
Diffstat (limited to 'integration_test')
-rw-r--r-- | integration_test/consensus_test.go | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/integration_test/consensus_test.go b/integration_test/consensus_test.go index 08a1d10..2680cd2 100644 --- a/integration_test/consensus_test.go +++ b/integration_test/consensus_test.go @@ -145,8 +145,13 @@ func (s *ConsensusTestSuite) syncBlocksWithSomeNode( syncNode.gov.CatchUpWithRound( b.Position.Round + core.ConfigRoundShift) } - syncedCon, err = syncerObj.SyncBlocks(compactionChainBlocks, true) - if syncedCon != nil || err != nil { + var synced bool + synced, err = syncerObj.SyncBlocks(compactionChainBlocks, true) + if err != nil { + done = true + } + if synced { + syncedCon, err = syncerObj.GetSyncedConsensus() done = true } compactionChainBlocks = nil |