diff options
author | Zsolt Felfoldi <zsfelfoldi@gmail.com> | 2016-11-30 13:02:08 +0800 |
---|---|---|
committer | Zsolt Felfoldi <zsfelfoldi@gmail.com> | 2016-12-10 16:53:08 +0800 |
commit | af8a742d00f9d47b832f6f2d50a8e1c89bbf8441 (patch) | |
tree | 92fca6d9750797a9c5f1fc712e2de1181be60390 /light | |
parent | e67500aa15a2f51a96f0ae91ab3af898b81d82f2 (diff) | |
download | go-tangerine-af8a742d00f9d47b832f6f2d50a8e1c89bbf8441.tar.gz go-tangerine-af8a742d00f9d47b832f6f2d50a8e1c89bbf8441.tar.zst go-tangerine-af8a742d00f9d47b832f6f2d50a8e1c89bbf8441.zip |
les: improved header fetcher and server statistics
Diffstat (limited to 'light')
-rw-r--r-- | light/lightchain.go | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/light/lightchain.go b/light/lightchain.go index 1cea7a892..d397f5006 100644 --- a/light/lightchain.go +++ b/light/lightchain.go @@ -505,3 +505,14 @@ func (self *LightChain) SyncCht(ctx context.Context) bool { } return false } + +// LockChain locks the chain mutex for reading so that multiple canonical hashes can be +// retrieved while it is guaranteed that they belong to the same version of the chain +func (self *LightChain) LockChain() { + self.chainmu.RLock() +} + +// UnlockChain unlocks the chain mutex +func (self *LightChain) UnlockChain() { + self.chainmu.RUnlock() +} |