Distinguish the failure cases of wfcheck in tree.

This commit is contained in:
Sean Bowe 2016-05-03 11:23:54 -06:00
parent 6f1b70300d
commit 26007222e8
1 changed files with 2 additions and 2 deletions

View File

@ -59,12 +59,12 @@ void IncrementalMerkleTree<Depth, Hash>::wfcheck() const {
// Left cannot be empty when right exists.
if (!left && right) {
throw std::ios_base::failure("tree has non-canonical representation of tree");
throw std::ios_base::failure("tree has non-canonical representation; right should not exist");
}
// Left cannot be empty when parents is nonempty.
if (!left && parents.size() > 0) {
throw std::ios_base::failure("tree has non-canonical representation of tree");
throw std::ios_base::failure("tree has non-canonical representation; parents should not be unempty");
}
}