aboutsummaryrefslogtreecommitdiffstats
path: root/core/state
diff options
context:
space:
mode:
Diffstat (limited to 'core/state')
-rw-r--r--core/state/sync.go3
-rw-r--r--core/state/sync_test.go4
2 files changed, 3 insertions, 4 deletions
diff --git a/core/state/sync.go b/core/state/sync.go
index 5a388886c..ef2b4b84c 100644
--- a/core/state/sync.go
+++ b/core/state/sync.go
@@ -26,14 +26,13 @@ import (
"github.com/ethereum/go-ethereum/trie"
)
-// StateSync is the main state synchronisation scheduler, which provides yet the
+// StateSync is the main state synchronisation scheduler, which provides yet the
// unknown state hashes to retrieve, accepts node data associated with said hashes
// and reconstructs the state database step by step until all is done.
type StateSync trie.TrieSync
// NewStateSync create a new state trie download scheduler.
func NewStateSync(root common.Hash, database ethdb.Database) *StateSync {
- // Pre-declare the result syncer t
var syncer *trie.TrieSync
callback := func(leaf []byte, parent common.Hash) error {
diff --git a/core/state/sync_test.go b/core/state/sync_test.go
index f0376d484..0dab372ba 100644
--- a/core/state/sync_test.go
+++ b/core/state/sync_test.go
@@ -38,7 +38,7 @@ type testAccount struct {
func makeTestState() (ethdb.Database, common.Hash, []*testAccount) {
// Create an empty state
db, _ := ethdb.NewMemDatabase()
- state := New(common.Hash{}, db)
+ state, _ := New(common.Hash{}, db)
// Fill it with some arbitrary data
accounts := []*testAccount{}
@@ -68,7 +68,7 @@ func makeTestState() (ethdb.Database, common.Hash, []*testAccount) {
// checkStateAccounts cross references a reconstructed state with an expected
// account array.
func checkStateAccounts(t *testing.T, db ethdb.Database, root common.Hash, accounts []*testAccount) {
- state := New(root, db)
+ state, _ := New(root, db)
for i, acc := range accounts {
if balance := state.GetBalance(acc.address); balance.Cmp(acc.balance) != 0 {