@@ -34,7 +34,6 @@ type Hasher struct {
3434 bmt * tree // prebuilt BMT resource for flowcontrol and proofs
3535 size int // bytes written to Hasher since last Reset()
3636 pos int // index of rightmost currently open segment
37- offset int // offset (cursor position) within currently open segment
3837 result chan []byte // result channel
3938 errc chan error // error channel
4039 span []byte // The span of the data subsumed under the chunk
@@ -49,7 +48,7 @@ func NewHasher(hasherFact func() hash.Hash) *Hasher {
4948 result : make (chan []byte ),
5049 errc : make (chan error , 1 ),
5150 span : make ([]byte , SpanSize ),
52- bmt : newTree (conf .segmentSize , conf . maxSize , conf .depth , conf .hasher ),
51+ bmt : newTree (conf .maxSize , conf .depth , conf .hasher ),
5352 }
5453}
5554
@@ -126,7 +125,6 @@ func (h *Hasher) Write(b []byte) (int, error) {
126125 copy (h .bmt .buffer [h .size :], b )
127126 secsize := 2 * h .segmentSize
128127 from := h .size / secsize
129- h .offset = h .size % secsize
130128 h .size += l
131129 to := h .size / secsize
132130 if l == maxVal {
@@ -143,7 +141,6 @@ func (h *Hasher) Write(b []byte) (int, error) {
143141func (h * Hasher ) Reset () {
144142 h .pos = 0
145143 h .size = 0
146- h .offset = 0
147144 copy (h .span , zerospan )
148145}
149146
@@ -182,7 +179,6 @@ func (h *Hasher) processSection(i int, final bool) {
182179// since hashing the parent is synchronous the same hasher can be used.
183180func (h * Hasher ) writeNode (n * node , isLeft bool , s []byte ) {
184181 var err error
185- level := 1
186182 for {
187183 // at the root of the bmt just write the result to the result channel
188184 if n == nil {
@@ -211,7 +207,6 @@ func (h *Hasher) writeNode(n *node, isLeft bool, s []byte) {
211207 }
212208 isLeft = n .isLeft
213209 n = n .parent
214- level ++
215210 }
216211}
217212
0 commit comments