Make the SHAMap hash a distinct type from a uint256.

* Implement a type safe distinction between a node hash and a node id.
* This is just the first phase, limited to SHAMap's internals.
This commit is contained in:
Howard Hinnant
2015-11-10 13:51:28 -05:00
committed by Nik Bougalis
parent 49c4a063c1
commit 21a7b62c2b
17 changed files with 182 additions and 134 deletions

View File

@@ -204,7 +204,8 @@ SHAMapAddNode TransactionAcquire::takeNodes (const std::list<SHAMapNodeID>& node
{
if (mHaveRoot)
JLOG (j_.debug) << "Got root TXS node, already have it";
else if (!mMap->addRootNode (getHash (), *nodeDatait, snfWIRE, nullptr).isGood())
else if (!mMap->addRootNode (SHAMapHash{getHash ()},
*nodeDatait, snfWIRE, nullptr).isGood())
{
JLOG (j_.warning) << "TX acquire got bad root node";
}