Skip to content

Commit

Permalink
remove unused WriteHeader function
Browse files Browse the repository at this point in the history
  • Loading branch information
didaunesp committed May 30, 2024
1 parent 4b61744 commit 530e689
Showing 1 changed file with 0 additions and 25 deletions.
25 changes: 0 additions & 25 deletions core/rawdb/accessors_chain.go
Original file line number Diff line number Diff line change
Expand Up @@ -306,31 +306,6 @@ func ReadHeader(db ethdb.Reader, hash common.Hash) *types.WorkObject {
return wo
}

// WriteHeader stores a block header into the database and also stores the hash-
// to-number mapping.
func WriteHeader(db ethdb.KeyValueWriter, header *types.Header, nodeCtx int) {
var (
hash = header.Hash()
number = header.NumberU64(nodeCtx)
)
// Write the hash -> number mapping
WriteHeaderNumber(db, hash, number)

// Write the encoded header
protoHeader, err := header.ProtoEncode()
if err != nil {
db.Logger().WithField("err", err).Fatal("Failed to proto encode header")
}
data, err := proto.Marshal(protoHeader)
if err != nil {
db.Logger().WithField("err", err).Fatal("Failed to proto Marshal header")
}
key := headerKey(number, hash)
if err := db.Put(key, data); err != nil {
db.Logger().WithField("err", err).Fatal("Failed to store header")
}
}

// DeleteHeader removes all block header data associated with a hash.
func DeleteHeader(db ethdb.KeyValueWriter, hash common.Hash, number uint64) {
deleteHeaderWithoutNumber(db, hash, number)
Expand Down

0 comments on commit 530e689

Please sign in to comment.