aboutsummaryrefslogtreecommitdiffstats
path: root/core/blockchain.go
diff options
context:
space:
mode:
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
}