eth/downloader: save and load trie sync progress (#16224)

This commit is contained in:
Péter Szilágyi
2018-03-03 01:52:39 +02:00
committed by Felix Lange
parent 12f4d28411
commit ca64a122d3
3 changed files with 29 additions and 1 deletions

View File

@@ -27,6 +27,7 @@ import (
ethereum "github.com/ethereum/go-ethereum"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/core"
"github.com/ethereum/go-ethereum/core/types"
"github.com/ethereum/go-ethereum/ethdb"
"github.com/ethereum/go-ethereum/event"
@@ -221,7 +222,10 @@ func New(mode SyncMode, stateDb ethdb.Database, mux *event.TypeMux, chain BlockC
quitCh: make(chan struct{}),
stateCh: make(chan dataPack),
stateSyncStart: make(chan *stateSync),
trackStateReq: make(chan *stateReq),
syncStatsState: stateSyncStats{
processed: core.GetTrieSyncProgress(stateDb),
},
trackStateReq: make(chan *stateReq),
}
go dl.qosTuner()
go dl.stateFetcher()