diff options
author | Taylor Gerring <taylor.gerring@gmail.com> | 2015-02-11 18:40:12 +0800 |
---|---|---|
committer | Taylor Gerring <taylor.gerring@gmail.com> | 2015-02-11 18:40:12 +0800 |
commit | cfddb7f3cd3b8cecb1e59412ce4db5769f6c8007 (patch) | |
tree | ab28c518bd1b78f6b8ac8b241951ad161cb268a9 /trie/cache.go | |
parent | 21fd31dad8bc6e0291ca405314b516670333c707 (diff) | |
parent | c6af5f0a275608ea6c797ef826e6090885f24eac (diff) | |
download | dexon-cfddb7f3cd3b8cecb1e59412ce4db5769f6c8007.tar dexon-cfddb7f3cd3b8cecb1e59412ce4db5769f6c8007.tar.gz dexon-cfddb7f3cd3b8cecb1e59412ce4db5769f6c8007.tar.bz2 dexon-cfddb7f3cd3b8cecb1e59412ce4db5769f6c8007.tar.lz dexon-cfddb7f3cd3b8cecb1e59412ce4db5769f6c8007.tar.xz dexon-cfddb7f3cd3b8cecb1e59412ce4db5769f6c8007.tar.zst dexon-cfddb7f3cd3b8cecb1e59412ce4db5769f6c8007.zip |
Merge branch 'develop' into jsonrpc
Conflicts:
rpc/ws/server.go
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) } |