Remove some dead SHAMapMissingNode code

This commit is contained in:
David Schwartz
2014-07-21 12:20:25 -07:00
committed by Vinnie Falco
parent b6eec21ec0
commit f4fcb1cc9a
2 changed files with 2 additions and 46 deletions

View File

@@ -175,15 +175,7 @@ SHAMap::getStack (uint256 const& id, bool include_nonmatching_leaf)
if (!node->descend (branch, nodeID, nodeHash))
return stack;
try
{
node = getNode (nodeID, nodeHash, false);
}
catch (SHAMapMissingNode& mn)
{
mn.setTargetNode (id);
throw;
}
node = getNode (nodeID, nodeHash, false);
}
if (include_nonmatching_leaf || (node->peekItem ()->getTag () == id))
@@ -251,15 +243,7 @@ SHAMapTreeNode::pointer SHAMap::walkTo (uint256 const& id, bool modify)
if (!inNode->descend (branch, nodeID, nodeHash))
return inNode;
try
{
inNode = getNode (nodeID, nodeHash, false);
}
catch (SHAMapMissingNode& mn)
{
mn.setTargetNode (id);
throw;
}
inNode = getNode (nodeID, nodeHash, false);
}
if (inNode->getTag () != id)

View File

@@ -42,27 +42,10 @@ public:
{
}
SHAMapMissingNode (SHAMapType t,
SHAMapNodeID const& nodeID,
uint256 const& nodeHash,
uint256 const& targetIndex)
: std::runtime_error (nodeID.getString ())
, mType (t)
, mNodeID (nodeID)
, mNodeHash (nodeHash)
, mTargetIndex (targetIndex)
{
}
virtual ~SHAMapMissingNode () throw ()
{
}
void setTargetNode (uint256 const& tn)
{
mTargetIndex = tn;
}
SHAMapType getMapType () const
{
return mType;
@@ -78,21 +61,10 @@ public:
return mNodeHash;
}
uint256 const& getTargetIndex () const
{
return mTargetIndex;
}
bool hasTargetIndex () const
{
return !mTargetIndex.isZero ();
}
private:
SHAMapType mType;
SHAMapNodeID mNodeID;
uint256 mNodeHash;
uint256 mTargetIndex;
};
extern std::ostream& operator<< (std::ostream&, SHAMapMissingNode const&);