aboutsummaryrefslogtreecommitdiff
path: root/core/storage.go
diff options
context:
space:
mode:
Diffstat (limited to 'core/storage.go')
-rw-r--r--core/storage.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/core/storage.go b/core/storage.go
index 8346c12..6e9245a 100644
--- a/core/storage.go
+++ b/core/storage.go
@@ -27,6 +27,10 @@ type Node struct {
PrevNodeSum string
}
+func (n *Node) GetHash() (string, error) {
+ return calculateStringHash(fmt.Sprintf("%d%d%s%s", n.BlockStart, n.BlockEnd, n.BlockSum, n.PrevNodeSum))
+}
+
func parseUnitSpec(size []byte) int {
switch size[0] {
case 0: