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-04-09 21:32:53 +0800
commit3a84568a63f64423683a1dbb9f46cee886a39270 (patch)
tree070d3478a6f2031b447148ee1d51a952565c02ab /core/blockchain.go
parentc1138b576524413f8d5755f77aaebd759d6317fc (diff)
downloaddexon-3a84568a63f64423683a1dbb9f46cee886a39270.tar
dexon-3a84568a63f64423683a1dbb9f46cee886a39270.tar.gz
dexon-3a84568a63f64423683a1dbb9f46cee886a39270.tar.bz2
dexon-3a84568a63f64423683a1dbb9f46cee886a39270.tar.lz
dexon-3a84568a63f64423683a1dbb9f46cee886a39270.tar.xz
dexon-3a84568a63f64423683a1dbb9f46cee886a39270.tar.zst
dexon-3a84568a63f64423683a1dbb9f46cee886a39270.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 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
}