diff options
-rw-r--r-- | core/consensus.go | 4 | ||||
-rw-r--r-- | core/test/network.go | 2 |
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) { |