Make CHash256/CHash160 output to Span

This commit is contained in:
Pieter Wuille
2020-06-18 17:19:46 -07:00
parent 0ef97b1b10
commit 02c4cc5c5d
13 changed files with 28 additions and 26 deletions

View File

@@ -60,7 +60,7 @@ static void MerkleComputation(const std::vector<uint256>& leaves, uint256* proot
}
}
mutated |= (inner[level] == h);
CHash256().Write(inner[level]).Write(h).Finalize(h.begin());
CHash256().Write(inner[level]).Write(h).Finalize(h);
}
// Store the resulting hash at inner position level.
inner[level] = h;
@@ -86,7 +86,7 @@ static void MerkleComputation(const std::vector<uint256>& leaves, uint256* proot
if (pbranch && matchh) {
pbranch->push_back(h);
}
CHash256().Write(h).Write(h).Finalize(h.begin());
CHash256().Write(h).Write(h).Finalize(h);
// Increment count to the value it would have if two entries at this
// level had existed.
count += (((uint32_t)1) << level);
@@ -101,7 +101,7 @@ static void MerkleComputation(const std::vector<uint256>& leaves, uint256* proot
matchh = true;
}
}
CHash256().Write(inner[level]).Write(h).Finalize(h.begin());
CHash256().Write(inner[level]).Write(h).Finalize(h);
level++;
}
}