From 3a84568a63f64423683a1dbb9f46cee886a39270 Mon Sep 17 00:00:00 2001 From: Wei-Ning Huang Date: Wed, 14 Nov 2018 10:57:53 +0800 Subject: core: validate DKG set with correct nodeset in round-2 (#19) * vendor: sync consensus core * core: validate DKG set with correct nodeset in round-2 --- core/blockchain.go | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'core/blockchain.go') diff --git a/core/blockchain.go b/core/blockchain.go index 3c9e9701d..3b71cb64b 100644 --- a/core/blockchain.go +++ b/core/blockchain.go @@ -2165,7 +2165,11 @@ func (bc *BlockChain) SubscribeLogsEvent(ch chan<- []*types.Log) event.Subscript return bc.scope.Track(bc.logsFeed.Subscribe(ch)) } -// GetRoundHeightMap returns the mapping between round and height. -func (bc *BlockChain) GetRoundHeightMap() sync.Map { - return bc.roundHeightMap +// GetRoundHeight returns the height of a given round. +func (bc *BlockChain) GetRoundHeight(round uint64) (uint64, bool) { + h, ok := bc.roundHeightMap.Load(round) + if !ok { + return 0, false + } + return h.(uint64), true } -- cgit v1.2.3