MCPcopy Create free account
hub / github.com/SmartPool/smartpool-client / Finalize

Method Finalize

mtree/merkle_tree.go:109–121  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

107}
108
109func (mt *MerkleTree) Finalize() {
110 if !mt.finalized && mt.mtbuf.Len() > 1 {
111 for {
112 dupNode := mt.mtbuf.Back().Value.(node).Copy()
113 mt.dnf(dupNode.Data)
114 mt.insertNode(dupNode)
115 if mt.mtbuf.Len() == 1 {
116 break
117 }
118 }
119 }
120 mt.finalized = true
121}
122
123func (mt MerkleTree) Root() NodeData {
124 if mt.finalized {

Callers 4

buildProofAugTreeMethod · 0.80
buildAugTreeMethod · 0.80
SetEpochDataMethod · 0.80
buildDagTreeMethod · 0.80

Calls 3

insertNodeMethod · 0.95
LenMethod · 0.80
CopyMethod · 0.65

Tested by

no test coverage detected