diff --git a/core/rawdb/accessors_indexes.go b/core/rawdb/accessors_indexes.go index 4ff7e5bd35..fcb06a3a52 100644 --- a/core/rawdb/accessors_indexes.go +++ b/core/rawdb/accessors_indexes.go @@ -57,6 +57,16 @@ func WriteTxLookupEntries(db DatabaseWriter, block *types.Block) { } } +func WriteTxLookupEntry(db DatabaseWriter, entry *TxLookupEntry, txHash common.Hash) { + data, err := rlp.EncodeToBytes(entry) + if err != nil { + log.Crit("Failed to encode transaction lookup entry", "err", err) + } + if err := db.Put(txLookupKey(txHash), data); err != nil { + log.Crit("Failed to store transaction lookup entry", "err", err) + } +} + // DeleteTxLookupEntry removes all transaction data associated with a hash. func DeleteTxLookupEntry(db DatabaseDeleter, hash common.Hash) { db.Delete(txLookupKey(hash))