diff options
author | Péter Szilágyi <peterke@gmail.com> | 2018-03-03 07:52:39 +0800 |
---|---|---|
committer | Felix Lange <fjl@users.noreply.github.com> | 2018-03-03 07:52:39 +0800 |
commit | ca64a122d33008c155c35a9d0e78cfbcafb1820a (patch) | |
tree | d82ca9f07ba8eadd116d08861e96c3283b1b76e4 /eth/downloader/statesync.go | |
parent | 12f4d284114a719e9a0779933e8770c352ed1767 (diff) | |
download | dexon-ca64a122d33008c155c35a9d0e78cfbcafb1820a.tar dexon-ca64a122d33008c155c35a9d0e78cfbcafb1820a.tar.gz dexon-ca64a122d33008c155c35a9d0e78cfbcafb1820a.tar.bz2 dexon-ca64a122d33008c155c35a9d0e78cfbcafb1820a.tar.lz dexon-ca64a122d33008c155c35a9d0e78cfbcafb1820a.tar.xz dexon-ca64a122d33008c155c35a9d0e78cfbcafb1820a.tar.zst dexon-ca64a122d33008c155c35a9d0e78cfbcafb1820a.zip |
eth/downloader: save and load trie sync progress (#16224)
Diffstat (limited to 'eth/downloader/statesync.go')
-rw-r--r-- | eth/downloader/statesync.go | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/eth/downloader/statesync.go b/eth/downloader/statesync.go index 9cc65a208..ee6c7b491 100644 --- a/eth/downloader/statesync.go +++ b/eth/downloader/statesync.go @@ -23,6 +23,7 @@ import ( "time" "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/core" "github.com/ethereum/go-ethereum/core/state" "github.com/ethereum/go-ethereum/crypto/sha3" "github.com/ethereum/go-ethereum/ethdb" @@ -466,4 +467,7 @@ func (s *stateSync) updateStats(written, duplicate, unexpected int, duration tim if written > 0 || duplicate > 0 || unexpected > 0 { log.Info("Imported new state entries", "count", written, "elapsed", common.PrettyDuration(duration), "processed", s.d.syncStatsState.processed, "pending", s.d.syncStatsState.pending, "retry", len(s.tasks), "duplicate", s.d.syncStatsState.duplicate, "unexpected", s.d.syncStatsState.unexpected) } + if written > 0 { + core.WriteTrieSyncProgress(s.d.stateDB, s.d.syncStatsState.processed) + } } |