Skip to content

Commit 1ff152f

Browse files
CoreyLinkaralabe
authored andcommitted
rawdb: remove unused parameter for WritePreimages func (#18059)
* rawdb: remove unused parameter for WritePreimages func and modify a spelling mistake * rawdb: update the doc for function WritePreimages
1 parent f574c4e commit 1ff152f

File tree

4 files changed

+6
-7
lines changed

4 files changed

+6
-7
lines changed

cmd/utils/cmd.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -272,13 +272,13 @@ func ImportPreimages(db *ethdb.LDBDatabase, fn string) error {
272272
// Accumulate the preimages and flush when enough ws gathered
273273
preimages[crypto.Keccak256Hash(blob)] = common.CopyBytes(blob)
274274
if len(preimages) > 1024 {
275-
rawdb.WritePreimages(db, 0, preimages)
275+
rawdb.WritePreimages(db, preimages)
276276
preimages = make(map[common.Hash][]byte)
277277
}
278278
}
279279
// Flush the last batch preimage data
280280
if len(preimages) > 0 {
281-
rawdb.WritePreimages(db, 0, preimages)
281+
rawdb.WritePreimages(db, preimages)
282282
}
283283
return nil
284284
}

core/blockchain.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1002,7 +1002,7 @@ func (bc *BlockChain) WriteBlockWithState(block *types.Block, receipts []*types.
10021002
}
10031003
// Write the positional metadata for transaction/receipt lookups and preimages
10041004
rawdb.WriteTxLookupEntries(batch, block)
1005-
rawdb.WritePreimages(batch, block.NumberU64(), state.Preimages())
1005+
rawdb.WritePreimages(batch, state.Preimages())
10061006

10071007
status = CanonStatTy
10081008
} else {

core/rawdb/accessors_metadata.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -77,9 +77,8 @@ func ReadPreimage(db DatabaseReader, hash common.Hash) []byte {
7777
return data
7878
}
7979

80-
// WritePreimages writes the provided set of preimages to the database. `number` is the
81-
// current block number, and is used for debug messages only.
82-
func WritePreimages(db DatabaseWriter, number uint64, preimages map[common.Hash][]byte) {
80+
// WritePreimages writes the provided set of preimages to the database.
81+
func WritePreimages(db DatabaseWriter, preimages map[common.Hash][]byte) {
8382
for hash, preimage := range preimages {
8483
if err := db.Put(preimageKey(hash), preimage); err != nil {
8584
log.Crit("Failed to store trie preimage", "err", err)

core/rawdb/schema.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ var (
3535
// headBlockKey tracks the latest know full block's hash.
3636
headBlockKey = []byte("LastBlock")
3737

38-
// headFastBlockKey tracks the latest known incomplete block's hash duirng fast sync.
38+
// headFastBlockKey tracks the latest known incomplete block's hash during fast sync.
3939
headFastBlockKey = []byte("LastFast")
4040

4141
// fastTrieProgressKey tracks the number of trie entries imported during fast sync.

0 commit comments

Comments
 (0)