aboutsummaryrefslogtreecommitdiffstats
path: root/trie/hashnode.go
diff options
context:
space:
mode:
authorJeffrey Wilcke <geffobscura@gmail.com>2015-07-01 21:38:32 +0800
committerJeffrey Wilcke <geffobscura@gmail.com>2015-07-04 08:51:36 +0800
commit0a1ff68c11706f60355b392cb16a681630260ac3 (patch)
treefa7e46110a346cc1a10e3a3135815942c4560859 /trie/hashnode.go
parentab16ce70fc68d9ab1b7d8cda57c180b4785cab6a (diff)
downloaddexon-0a1ff68c11706f60355b392cb16a681630260ac3.tar
dexon-0a1ff68c11706f60355b392cb16a681630260ac3.tar.gz
dexon-0a1ff68c11706f60355b392cb16a681630260ac3.tar.bz2
dexon-0a1ff68c11706f60355b392cb16a681630260ac3.tar.lz
dexon-0a1ff68c11706f60355b392cb16a681630260ac3.tar.xz
dexon-0a1ff68c11706f60355b392cb16a681630260ac3.tar.zst
dexon-0a1ff68c11706f60355b392cb16a681630260ac3.zip
trie: dirty tracking
Diffstat (limited to 'trie/hashnode.go')
-rw-r--r--trie/hashnode.go11
1 files changed, 8 insertions, 3 deletions
diff --git a/trie/hashnode.go b/trie/hashnode.go
index 8125cc3c9..e82ab8069 100644
--- a/trie/hashnode.go
+++ b/trie/hashnode.go
@@ -3,12 +3,13 @@ package trie
import "github.com/ethereum/go-ethereum/common"
type HashNode struct {
- key []byte
- trie *Trie
+ key []byte
+ trie *Trie
+ dirty bool
}
func NewHash(key []byte, trie *Trie) *HashNode {
- return &HashNode{key, trie}
+ return &HashNode{key, trie, false}
}
func (self *HashNode) RlpData() interface{} {
@@ -19,6 +20,10 @@ func (self *HashNode) Hash() interface{} {
return self.key
}
+func (self *HashNode) setDirty(dirty bool) {
+ self.dirty = dirty
+}
+
// These methods will never be called but we have to satisfy Node interface
func (self *HashNode) Value() Node { return nil }
func (self *HashNode) Dirty() bool { return true }