aboutsummaryrefslogtreecommitdiffstats
path: root/core/state/sync.go
diff options
context:
space:
mode:
authorFelix Lange <fjl@twurst.com>2017-01-05 22:58:00 +0800
committerFelix Lange <fjl@twurst.com>2017-01-06 21:15:22 +0800
commitd3b751e4d94f95f6cc89544852f2d5811e075665 (patch)
tree14e3417894593f9922551dcb24c3a9d3383f69a2 /core/state/sync.go
parent7731061903bb992f7630ab389863951efb360258 (diff)
downloadgo-tangerine-d3b751e4d94f95f6cc89544852f2d5811e075665.tar
go-tangerine-d3b751e4d94f95f6cc89544852f2d5811e075665.tar.gz
go-tangerine-d3b751e4d94f95f6cc89544852f2d5811e075665.tar.bz2
go-tangerine-d3b751e4d94f95f6cc89544852f2d5811e075665.tar.lz
go-tangerine-d3b751e4d94f95f6cc89544852f2d5811e075665.tar.xz
go-tangerine-d3b751e4d94f95f6cc89544852f2d5811e075665.tar.zst
go-tangerine-d3b751e4d94f95f6cc89544852f2d5811e075665.zip
trie: remove dependency on ethdb
This removes the core/types -> leveldb dependency.
Diffstat (limited to 'core/state/sync.go')
-rw-r--r--core/state/sync.go7
1 files changed, 3 insertions, 4 deletions
diff --git a/core/state/sync.go b/core/state/sync.go
index bab9c8e7e..8456a810b 100644
--- a/core/state/sync.go
+++ b/core/state/sync.go
@@ -21,7 +21,6 @@ import (
"math/big"
"github.com/ethereum/go-ethereum/common"
- "github.com/ethereum/go-ethereum/ethdb"
"github.com/ethereum/go-ethereum/rlp"
"github.com/ethereum/go-ethereum/trie"
)
@@ -32,7 +31,7 @@ import (
type StateSync trie.TrieSync
// NewStateSync create a new state trie download scheduler.
-func NewStateSync(root common.Hash, database ethdb.Database) *StateSync {
+func NewStateSync(root common.Hash, database trie.DatabaseReader) *StateSync {
var syncer *trie.TrieSync
callback := func(leaf []byte, parent common.Hash) error {
@@ -62,8 +61,8 @@ func (s *StateSync) Missing(max int) []common.Hash {
// Process injects a batch of retrieved trie nodes data, returning if something
// was committed to the database and also the index of an entry if processing of
// it failed.
-func (s *StateSync) Process(list []trie.SyncResult) (bool, int, error) {
- return (*trie.TrieSync)(s).Process(list)
+func (s *StateSync) Process(list []trie.SyncResult, dbw trie.DatabaseWriter) (bool, int, error) {
+ return (*trie.TrieSync)(s).Process(list, dbw)
}
// Pending returns the number of state entries currently pending for download.