mirror of
https://github.com/nspcc-dev/neo-go.git
synced 2024-11-25 03:47:18 +00:00
core: handle empty MPT batch properly
It's OK to have it.
This commit is contained in:
parent
e3443b82a4
commit
e13816f3fd
1 changed files with 3 additions and 0 deletions
|
@ -43,6 +43,9 @@ func (b *Batch) Add(key []byte, value []byte) {
|
|||
// and won't strip the resulting branch node.
|
||||
// However it is used mostly after the block processing to update MPT and error is not expected.
|
||||
func (t *Trie) PutBatch(b Batch) (int, error) {
|
||||
if len(b.kv) == 0 {
|
||||
return 0, nil
|
||||
}
|
||||
r, n, err := t.putBatch(b.kv)
|
||||
t.root = r
|
||||
return n, err
|
||||
|
|
Loading…
Reference in a new issue