aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJimmy Hu <jimmy.hu@dexon.org>2018-11-19 15:16:07 +0800
committerGitHub <noreply@github.com>2018-11-19 15:16:07 +0800
commit245e5aca956c840246d81ccd49ca5e70a96cd128 (patch)
tree1db757284cdeaaf9c68c173a3772c67b6e389254
parentd0b29b6c2295550dd5ac75153fa3cfb469cf3fb2 (diff)
downloadtangerine-consensus-245e5aca956c840246d81ccd49ca5e70a96cd128.tar.gz
tangerine-consensus-245e5aca956c840246d81ccd49ca5e70a96cd128.tar.zst
tangerine-consensus-245e5aca956c840246d81ccd49ca5e70a96cd128.zip
core, test: Fix various issues (#337)
-rw-r--r--core/consensus.go4
-rw-r--r--core/test/network.go2
2 files changed, 4 insertions, 2 deletions
diff --git a/core/consensus.go b/core/consensus.go
index d5a386d..215b9f7 100644
--- a/core/consensus.go
+++ b/core/consensus.go
@@ -136,6 +136,8 @@ func (recv *consensusBAReceiver) ConfirmBlock(
"hash", hash,
"chainID", recv.chainID)
recv.agreementModule.addCandidateBlock(block)
+ recv.agreementModule.lock.Lock()
+ defer recv.agreementModule.lock.Unlock()
recv.ConfirmBlock(block.Hash, votes)
}()
return
@@ -570,7 +572,7 @@ func (con *Consensus) runDKG(round uint64, config *types.Config) {
}
}()
if err := con.cfgModule.runDKG(round); err != nil {
- panic(err)
+ con.logger.Error("Failed to runDKG", "error", err)
}
}()
}
diff --git a/core/test/network.go b/core/test/network.go
index e603a45..8bcb050 100644
--- a/core/test/network.go
+++ b/core/test/network.go
@@ -544,7 +544,7 @@ func (n *Network) addBlockToCache(b *types.Block) {
break
}
}
- n.blockCache[b.Hash] = b
+ n.blockCache[b.Hash] = b.Clone()
}
func (n *Network) addVoteToCache(v *types.Vote) {