aboutsummaryrefslogtreecommitdiffstats
path: root/core/consensus_test.go
diff options
context:
space:
mode:
authorMission Liao <mission.liao@dexon.org>2019-01-11 12:58:30 +0800
committerGitHub <noreply@github.com>2019-01-11 12:58:30 +0800
commit809e8def862fdfa792061a448f952747f1af4d3c (patch)
treebd038971e65a09bc9bb399f03a37b194ce67ae3c /core/consensus_test.go
parentfa25817354d5b7d40f5911004232392acfe7fe53 (diff)
downloaddexon-consensus-809e8def862fdfa792061a448f952747f1af4d3c.tar
dexon-consensus-809e8def862fdfa792061a448f952747f1af4d3c.tar.gz
dexon-consensus-809e8def862fdfa792061a448f952747f1af4d3c.tar.bz2
dexon-consensus-809e8def862fdfa792061a448f952747f1af4d3c.tar.lz
dexon-consensus-809e8def862fdfa792061a448f952747f1af4d3c.tar.xz
dexon-consensus-809e8def862fdfa792061a448f952747f1af4d3c.tar.zst
dexon-consensus-809e8def862fdfa792061a448f952747f1af4d3c.zip
syncer: fix issues when switching to core.Consensus (#418)
- when confirmed blocks passed to core.Consensus aren't continuous in position in some chain, the pulling would skip those missing blocks. - fix: when some block is missing, avoid adding it and all blocks after it to core.Consensus. - we need to avoid the receive channel of network module full. - fix: during switching to core.Consensus, we need to launch a dummy receiver to receive from receive channel of network module. - fix: between the period during core.Consensus created and before running, a dummy receiver is also required to receive from receive channel of network module.
Diffstat (limited to 'core/consensus_test.go')
-rw-r--r--core/consensus_test.go1
1 files changed, 1 insertions, 0 deletions
diff --git a/core/consensus_test.go b/core/consensus_test.go
index 938b56d..b53af8a 100644
--- a/core/consensus_test.go
+++ b/core/consensus_test.go
@@ -593,6 +593,7 @@ func (s *ConsensusTestSuite) TestSyncBA() {
prvKey := prvKeys[0]
_, con := s.prepareConsensus(time.Now().UTC(), gov, prvKey, conn)
go con.Run()
+ defer con.Stop()
hash := common.NewRandomHash()
signers := make([]*utils.Signer, 0, len(prvKeys))
for _, prvKey := range prvKeys {