diff options
Diffstat (limited to 'trie/cache.go')
-rw-r--r-- | trie/cache.go | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/trie/cache.go b/trie/cache.go index e03702b25..2143785fa 100644 --- a/trie/cache.go +++ b/trie/cache.go @@ -37,6 +37,14 @@ func (self *Cache) Flush() { //self.Reset() } +func (self *Cache) Copy() *Cache { + cache := NewCache(self.backend) + for k, v := range self.store { + cache.store[k] = v + } + return cache +} + func (self *Cache) Reset() { - self.store = make(map[string][]byte) + //self.store = make(map[string][]byte) } |