Fixed a copy issue in the trie which could cause a consensus failure

This commit is contained in:
obscuren
2015-02-02 19:58:34 -08:00
parent 6fecb150d6
commit 3c7181d28f
7 changed files with 54 additions and 20 deletions

View File

@ -37,6 +37,14 @@ func (self *Cache) Flush() {
//self.Reset()
}
func (self *Cache) Reset() {
self.store = make(map[string][]byte)
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)
}