diff options
author | Martin Holst Swende <martin@swende.se> | 2018-02-26 17:53:10 +0800 |
---|---|---|
committer | Péter Szilágyi <peterke@gmail.com> | 2018-02-26 17:53:10 +0800 |
commit | f83237573f0922dfc9fef17f79ccd06305ab6d16 (patch) | |
tree | 1f55222fb1e4bcdfccd63dd35afbc14f81e6165d /light | |
parent | d398d04e2779c5ebb9713929518f9305dd10af09 (diff) | |
download | dexon-f83237573f0922dfc9fef17f79ccd06305ab6d16.tar.gz dexon-f83237573f0922dfc9fef17f79ccd06305ab6d16.tar.zst dexon-f83237573f0922dfc9fef17f79ccd06305ab6d16.zip |
core: make current*Block atomic, and accessor functions mutex-free (#16171)
* core: make current*Block atomic, and accessor functions mutex-free
* core: fix review concerns
* core: fix error in atomic assignment
* core/light: implement atomic getter/setter for headerchain
Diffstat (limited to 'light')
-rw-r--r-- | light/lightchain.go | 6 |
1 files changed, 0 insertions, 6 deletions
diff --git a/light/lightchain.go b/light/lightchain.go index 181a1c2a6..2784615d3 100644 --- a/light/lightchain.go +++ b/light/lightchain.go @@ -171,9 +171,6 @@ func (bc *LightChain) SetHead(head uint64) { // GasLimit returns the gas limit of the current HEAD block. func (self *LightChain) GasLimit() uint64 { - self.mu.RLock() - defer self.mu.RUnlock() - return self.hc.CurrentHeader().GasLimit } @@ -387,9 +384,6 @@ func (self *LightChain) InsertHeaderChain(chain []*types.Header, checkFreq int) // CurrentHeader retrieves the current head header of the canonical chain. The // header is retrieved from the HeaderChain's internal cache. func (self *LightChain) CurrentHeader() *types.Header { - self.mu.RLock() - defer self.mu.RUnlock() - return self.hc.CurrentHeader() } |