Merge pull request #2325 from nspcc-dev/lock-on-statejump
core: lock block addition on state jump
This commit is contained in:
commit
cc9e64ce61
1 changed files with 2 additions and 0 deletions
|
@ -502,8 +502,10 @@ func (bc *Blockchain) removeOldStorageItems() {
|
|||
// specified by the state sync point p. All the data needed for the jump must be
|
||||
// collected by the state sync module.
|
||||
func (bc *Blockchain) jumpToState(p uint32) error {
|
||||
bc.addLock.Lock()
|
||||
bc.lock.Lock()
|
||||
defer bc.lock.Unlock()
|
||||
defer bc.addLock.Unlock()
|
||||
|
||||
return bc.jumpToStateInternal(p, none)
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue