Merge pull request #2325 from nspcc-dev/lock-on-statejump

core: lock block addition on state jump
This commit is contained in:
Roman Khimov 2022-01-14 20:45:54 +03:00 committed by GitHub
commit cc9e64ce61
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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)
}