mirror of
https://github.com/nspcc-dev/neo-go.git
synced 2025-01-07 09:50:36 +00:00
dao: don't treat zero stateroot as valid during MPT init
Because it's not really valid and MPT state should be the same as if it was initialized at height 0. Fixes #1870
This commit is contained in:
parent
d8c8593410
commit
bcc2d1bb8f
1 changed files with 5 additions and 1 deletions
|
@ -531,7 +531,11 @@ func (dao *Simple) InitMPT(height uint32, enableRefCount bool) error {
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
dao.MPT = mpt.NewTrie(mpt.NewHashNode(r.Root), enableRefCount, dao.Store)
|
var rootnode mpt.Node
|
||||||
|
if !r.Root.Equals(util.Uint256{}) { // some initial blocks can have root == 0 and it's not a valid root
|
||||||
|
rootnode = mpt.NewHashNode(r.Root)
|
||||||
|
}
|
||||||
|
dao.MPT = mpt.NewTrie(rootnode, enableRefCount, dao.Store)
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue