aboutsummaryrefslogtreecommitdiffstats
path: root/trie/cache.go
diff options
context:
space:
mode:
Diffstat (limited to 'trie/cache.go')
-rw-r--r--trie/cache.go6
1 files changed, 4 insertions, 2 deletions
diff --git a/trie/cache.go b/trie/cache.go
index 2705b0e45..99d8033a6 100644
--- a/trie/cache.go
+++ b/trie/cache.go
@@ -38,6 +38,8 @@ func NewCache(backend Backend) *Cache {
}
func (self *Cache) Get(key []byte) []byte {
+ key = append(StatePre, key...)
+
data := self.store[string(key)]
if data == nil {
data, _ = self.backend.Get(key)
@@ -47,8 +49,8 @@ func (self *Cache) Get(key []byte) []byte {
}
func (self *Cache) Put(key []byte, data []byte) {
- // write the data to the ldb batch
- //self.batch.Put(key, rle.Compress(data))
+ key = append(StatePre, key...)
+
self.batch.Put(key, data)
self.store[string(key)] = data
}