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

@ -8,6 +8,6 @@ type ValueNode struct {
func (self *ValueNode) Value() Node { return self } // Best not to call :-)
func (self *ValueNode) Val() []byte { return self.data }
func (self *ValueNode) Dirty() bool { return true }
func (self *ValueNode) Copy() Node { return self }
func (self *ValueNode) Copy() Node { return &ValueNode{self.trie, self.data} }
func (self *ValueNode) RlpData() interface{} { return self.data }
func (self *ValueNode) Hash() interface{} { return self.data }