mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-19 10:22:23 +00:00
rawdb: Add WriteTxLookupEntry
This commit is contained in:
parent
1520f8ffbe
commit
c7ef06016a
1 changed files with 10 additions and 0 deletions
|
|
@ -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.
|
// DeleteTxLookupEntry removes all transaction data associated with a hash.
|
||||||
func DeleteTxLookupEntry(db DatabaseDeleter, hash common.Hash) {
|
func DeleteTxLookupEntry(db DatabaseDeleter, hash common.Hash) {
|
||||||
db.Delete(txLookupKey(hash))
|
db.Delete(txLookupKey(hash))
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue