Skip to content

Commit 1709cca

Browse files
committed
Fix bug in computation of new tree heads
We were dropping "the old head" from the wrong side.
1 parent d007153 commit 1709cca

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

mtc.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -798,7 +798,7 @@ func (p *CAParams) NewTreeHeads(prevHeads, root []byte) ([]byte, error) {
798798
len(root),
799799
)
800800
}
801-
return append(root, prevHeads[HashLen:]...), nil
801+
return append(root, prevHeads[:expected-HashLen]...), nil
802802
}
803803

804804
func (batch *Batch) Anchor() TrustAnchorIdentifier {

0 commit comments

Comments
 (0)