Fix a subtree comparison edge case (#7587)

This commit is contained in:
teor 2023-09-21 04:58:32 +10:00 committed by GitHub
parent 2b0b2a4292
commit 92d6da3531
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 2 deletions

View File

@ -440,7 +440,12 @@ impl NoteCommitmentTree {
return self.is_complete_subtree();
}
// If `self` is the next index, check for spurious index differences.
// If `self` is the next index, check if the last note completed a subtree.
if self.is_complete_subtree() {
return true;
}
// Then check for spurious index differences.
//
// There is one new subtree somewhere in the trees. It is either:
// - a new subtree at the end of the previous tree, or

View File

@ -421,7 +421,12 @@ impl NoteCommitmentTree {
return self.is_complete_subtree();
}
// If `self` is the next index, check for spurious index differences.
// If `self` is the next index, check if the last note completed a subtree.
if self.is_complete_subtree() {
return true;
}
// Then check for spurious index differences.
//
// There is one new subtree somewhere in the trees. It is either:
// - a new subtree at the end of the previous tree, or