aboutsummaryrefslogtreecommitdiffstats
path: root/core/blockchain.go
diff options
context:
space:
mode:
authorWei-Ning Huang <aitjcize@gmail.com>2018-11-14 10:57:53 +0800
committerWei-Ning Huang <w@dexon.org>2019-03-12 12:19:09 +0800
commit9919263fe225d6bbd0183fba578a84ecbac8aae6 (patch)
treeeba3fb16d35cb9db8769619ba5984fc4a9bfbfa6 /core/blockchain.go
parent9d1efe14607683825c69cce8f690e0f327c6a7b0 (diff)
downloaddexon-9919263fe225d6bbd0183fba578a84ecbac8aae6.tar
dexon-9919263fe225d6bbd0183fba578a84ecbac8aae6.tar.gz
dexon-9919263fe225d6bbd0183fba578a84ecbac8aae6.tar.bz2
dexon-9919263fe225d6bbd0183fba578a84ecbac8aae6.tar.lz
dexon-9919263fe225d6bbd0183fba578a84ecbac8aae6.tar.xz
dexon-9919263fe225d6bbd0183fba578a84ecbac8aae6.tar.zst
dexon-9919263fe225d6bbd0183fba578a84ecbac8aae6.zip
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
Diffstat (limited to 'core/blockchain.go')
-rw-r--r--core/blockchain.go10
1 files changed, 7 insertions, 3 deletions
diff --git a/core/blockchain.go b/core/blockchain.go
index 19b17db8f..cb235ba8c 100644
--- a/core/blockchain.go
+++ b/core/blockchain.go
@@ -2143,7 +2143,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
}