|
|
@ -92,20 +92,20 @@ func DeleteAccountSnapshot(db ethdb.KeyValueWriter, hash common.Hash) { |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// ReadStorageSnapshot retrieves the snapshot entry of an storage trie leaf.
|
|
|
|
// ReadStorageSnapshot retrieves the snapshot entry of a storage trie leaf.
|
|
|
|
func ReadStorageSnapshot(db ethdb.KeyValueReader, accountHash, storageHash common.Hash) []byte { |
|
|
|
func ReadStorageSnapshot(db ethdb.KeyValueReader, accountHash, storageHash common.Hash) []byte { |
|
|
|
data, _ := db.Get(storageSnapshotKey(accountHash, storageHash)) |
|
|
|
data, _ := db.Get(storageSnapshotKey(accountHash, storageHash)) |
|
|
|
return data |
|
|
|
return data |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// WriteStorageSnapshot stores the snapshot entry of an storage trie leaf.
|
|
|
|
// WriteStorageSnapshot stores the snapshot entry of a storage trie leaf.
|
|
|
|
func WriteStorageSnapshot(db ethdb.KeyValueWriter, accountHash, storageHash common.Hash, entry []byte) { |
|
|
|
func WriteStorageSnapshot(db ethdb.KeyValueWriter, accountHash, storageHash common.Hash, entry []byte) { |
|
|
|
if err := db.Put(storageSnapshotKey(accountHash, storageHash), entry); err != nil { |
|
|
|
if err := db.Put(storageSnapshotKey(accountHash, storageHash), entry); err != nil { |
|
|
|
log.Crit("Failed to store storage snapshot", "err", err) |
|
|
|
log.Crit("Failed to store storage snapshot", "err", err) |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// DeleteStorageSnapshot removes the snapshot entry of an storage trie leaf.
|
|
|
|
// DeleteStorageSnapshot removes the snapshot entry of a storage trie leaf.
|
|
|
|
func DeleteStorageSnapshot(db ethdb.KeyValueWriter, accountHash, storageHash common.Hash) { |
|
|
|
func DeleteStorageSnapshot(db ethdb.KeyValueWriter, accountHash, storageHash common.Hash) { |
|
|
|
if err := db.Delete(storageSnapshotKey(accountHash, storageHash)); err != nil { |
|
|
|
if err := db.Delete(storageSnapshotKey(accountHash, storageHash)); err != nil { |
|
|
|
log.Crit("Failed to delete storage snapshot", "err", err) |
|
|
|
log.Crit("Failed to delete storage snapshot", "err", err) |
|
|
|