core/state/snapshot: faster account iteration, CLI integration

This commit is contained in:
Martin Holst Swende
2020-01-19 20:57:56 +01:00
committed by Péter Szilágyi
parent 6ddb92a089
commit 19099421dc
9 changed files with 69 additions and 38 deletions

View File

@ -22,6 +22,7 @@ import (
"errors"
"fmt"
"sync"
"sync/atomic"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/core/rawdb"
@ -552,7 +553,7 @@ func (t *Tree) Rebuild(root common.Hash) {
case *diffLayer:
// If the layer is a simple diff, simply mark as stale
layer.lock.Lock()
layer.stale = true
atomic.StoreUint32(&layer.stale, 1)
layer.lock.Unlock()
default: