aboutsummaryrefslogtreecommitdiffstats
path: root/light
diff options
context:
space:
mode:
authorMartin Holst Swende <martin@swende.se>2018-02-26 17:53:10 +0800
committerPéter Szilágyi <peterke@gmail.com>2018-02-26 17:53:10 +0800
commitf83237573f0922dfc9fef17f79ccd06305ab6d16 (patch)
tree1f55222fb1e4bcdfccd63dd35afbc14f81e6165d /light
parentd398d04e2779c5ebb9713929518f9305dd10af09 (diff)
downloadgo-tangerine-f83237573f0922dfc9fef17f79ccd06305ab6d16.tar.gz
go-tangerine-f83237573f0922dfc9fef17f79ccd06305ab6d16.tar.zst
go-tangerine-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.go6
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()
}