Added caching and database interface to trie

* Reimplemented caching for trie
* Reimplemented resetting and persisting trie
This commit is contained in:
obscuren
2014-11-19 16:21:28 +01:00
parent e70529a977
commit 0f460ad26e
6 changed files with 135 additions and 39 deletions

View File

@ -17,7 +17,7 @@ func (self *ShortNode) Value() Node {
return self.value
}
func (self *ShortNode) Dirty() bool { return true }
func (self *ShortNode) Copy() Node { return self }
func (self *ShortNode) Copy() Node { return NewShortNode(self.trie, self.key, self.value) }
func (self *ShortNode) RlpData() interface{} {
return []interface{}{self.key, self.value.Hash()}