aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFelix Lange <fjl@users.noreply.github.com>2018-11-09 04:37:19 +0800
committerGitHub <noreply@github.com>2018-11-09 04:37:19 +0800
commit870efeef01ad45f1e06bbe4479e5afa9986f3518 (patch)
treeb62d39b232c095842ce755f5ae1f7c79118ad770
parent144c1c6c52456808428e2b69dbe5c4ebfc3606ca (diff)
downloadgo-tangerine-870efeef01ad45f1e06bbe4479e5afa9986f3518.tar.gz
go-tangerine-870efeef01ad45f1e06bbe4479e5afa9986f3518.tar.zst
go-tangerine-870efeef01ad45f1e06bbe4479e5afa9986f3518.zip
core/state: remove lock (#18065)
The lock in StateDB is useless. It's only held in Copy, but Copy is safe for concurrent use because all it does is read.
-rw-r--r--core/state/statedb.go6
1 files changed, 0 insertions, 6 deletions
diff --git a/core/state/statedb.go b/core/state/statedb.go
index f0d7cdb6e..76e67d839 100644
--- a/core/state/statedb.go
+++ b/core/state/statedb.go
@@ -22,7 +22,6 @@ import (
"fmt"
"math/big"
"sort"
- "sync"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/core/types"
@@ -87,8 +86,6 @@ type StateDB struct {
journal *journal
validRevisions []revision
nextRevisionId int
-
- lock sync.Mutex
}
// Create a new state from a given trie.
@@ -496,9 +493,6 @@ func (db *StateDB) ForEachStorage(addr common.Address, cb func(key, value common
// Copy creates a deep, independent copy of the state.
// Snapshots of the copied state cannot be applied to the copy.
func (self *StateDB) Copy() *StateDB {
- self.lock.Lock()
- defer self.lock.Unlock()
-
// Copy all the basic fields, initialize the memory ones
state := &StateDB{
db: self.db,