db migration fix: it was able run with delay #4732

This commit is contained in:
Alex Sharov 2022-07-18 14:38:01 +07:00 committed by GitHub
parent ac9b7d8cc2
commit 13bf5c30c1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -30,14 +30,14 @@ var resetBlocks = Migration{
if err := BeforeCommit(tx, nil, true); err != nil {
return err
}
return
return tx.Commit()
}
genesisBlock := rawdb.ReadHeaderByNumber(tx, 0)
if genesisBlock == nil {
if err := BeforeCommit(tx, nil, true); err != nil {
return err
}
return nil
return tx.Commit()
}
chainConfig, err := rawdb.ReadChainConfig(tx, genesisBlock.Hash())
if err != nil {