Merge pull request #20403 from karalabe/fix-freezer-reinit

core/rawdb: fix reinit regression caused by the hash check PR
This commit is contained in:
Péter Szilágyi 2019-11-27 15:05:58 +02:00 committed by GitHub
commit 58e33d9e5a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -55,10 +55,10 @@ func InitDatabaseFromFreezer(db ethdb.Database) error {
if n >= frozen {
return
}
// Retrieve the block from the freezer (no need for the hash, we pull by
// number from the freezer). If successful, pre-cache the block hash and
// the individual transaction hashes for storing into the database.
block := ReadBlock(db, common.Hash{}, n)
// Retrieve the block from the freezer. If successful, pre-cache
// the block hash and the individual transaction hashes for storing
// into the database.
block := ReadBlock(db, ReadCanonicalHash(db, n), n)
if block != nil {
block.Hash()
for _, tx := range block.Transactions() {