good morning!!!!

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

check canonical receipt (#1310)

parent 531d36ef
No related branches found
No related tags found
No related merge requests found
......@@ -11,6 +11,7 @@ import (
"github.com/ledgerwatch/turbo-geth/common"
"github.com/ledgerwatch/turbo-geth/common/dbutils"
"github.com/ledgerwatch/turbo-geth/common/etl"
"github.com/ledgerwatch/turbo-geth/core/rawdb"
"github.com/ledgerwatch/turbo-geth/core/types"
"github.com/ledgerwatch/turbo-geth/ethdb"
"github.com/ledgerwatch/turbo-geth/ethdb/cbor"
......@@ -170,6 +171,14 @@ var receiptsOnePerTx = Migration{
}()
if err := db.Walk(dbutils.BlockReceiptsPrefix, nil, 0, func(k, v []byte) (bool, error) {
blockNum := binary.BigEndian.Uint64(k[:8])
canonicalHash, err := rawdb.ReadCanonicalHash(db, blockNum)
if err != nil {
return false, err
}
if !bytes.Equal(k[8:], canonicalHash[:]) {
return true, nil
}
select {
default:
case <-logEvery.C:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment