Small nit fixes

This commit is contained in:
Sean Bowe
2016-04-29 10:05:06 -06:00
parent 6850b45e4d
commit 6f1b70300d
2 changed files with 8 additions and 11 deletions

View File

@@ -53,12 +53,7 @@ void IncrementalMerkleTree<Depth, Hash>::wfcheck() const {
}
// The last parent cannot be null.
bool wasnull = false;
BOOST_FOREACH(const boost::optional<Hash>& parent, parents) {
wasnull = !parent;
}
if (wasnull) {
if (!(parents.empty()) && !(parents.back())) {
throw std::ios_base::failure("tree has non-canonical representation of parent");
}
@@ -89,7 +84,7 @@ void IncrementalMerkleTree<Depth, Hash>::append(Hash obj) {
// Combine the leaves and propagate it up the tree
boost::optional<Hash> combined = Hash::combine(*left, *right);
// Set the left leaf to the object and make the right object none
// Set the "left" leaf to the object and make the "right" leaf none
left = obj;
right = boost::none;
@@ -261,7 +256,7 @@ MerklePath IncrementalMerkleTree<Depth, Hash>::path(std::deque<Hash> filler_hash
}
template<size_t Depth, typename Hash>
std::deque<Hash> IncrementalWitness<Depth, Hash>::uncle_train() const {
std::deque<Hash> IncrementalWitness<Depth, Hash>::partial_path() const {
std::deque<Hash> uncles(filled.begin(), filled.end());
if (cursor) {