good morning!!!!

Skip to content
Snippets Groups Projects
Unverified Commit bbc4cd4f authored by Alex Sharov's avatar Alex Sharov Committed by GitHub
Browse files

snapshots: use blockReader in IH stage (#3506)

* use blockReader in IH stage

* use blockReader in IH stage
parent ae652ad5
Branches
Tags
No related merge requests found
...@@ -15,7 +15,6 @@ import ( ...@@ -15,7 +15,6 @@ import (
"github.com/ledgerwatch/erigon/common" "github.com/ledgerwatch/erigon/common"
"github.com/ledgerwatch/erigon/common/changeset" "github.com/ledgerwatch/erigon/common/changeset"
"github.com/ledgerwatch/erigon/common/dbutils" "github.com/ledgerwatch/erigon/common/dbutils"
"github.com/ledgerwatch/erigon/core/rawdb"
"github.com/ledgerwatch/erigon/core/types/accounts" "github.com/ledgerwatch/erigon/core/types/accounts"
"github.com/ledgerwatch/erigon/eth/stagedsync/stages" "github.com/ledgerwatch/erigon/eth/stagedsync/stages"
"github.com/ledgerwatch/erigon/turbo/trie" "github.com/ledgerwatch/erigon/turbo/trie"
...@@ -66,12 +65,7 @@ func SpawnIntermediateHashesStage(s *StageState, u Unwinder, tx kv.RwTx, cfg Tri ...@@ -66,12 +65,7 @@ func SpawnIntermediateHashesStage(s *StageState, u Unwinder, tx kv.RwTx, cfg Tri
var expectedRootHash common.Hash var expectedRootHash common.Hash
var headerHash common.Hash var headerHash common.Hash
if cfg.checkRoot { if cfg.checkRoot {
var hash common.Hash syncHeadHeader, err := cfg.blockReader.HeaderByNumber(ctx, tx, to)
hash, err = rawdb.ReadCanonicalHash(tx, to)
if err != nil {
return trie.EmptyRoot, err
}
syncHeadHeader, err := cfg.blockReader.Header(ctx, tx, hash, to)
if err != nil { if err != nil {
return trie.EmptyRoot, err return trie.EmptyRoot, err
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment