Remove dead code. Change unit tests to compensate.

This commit is contained in:
JoelKatz
2012-04-23 15:58:05 -07:00
parent 238b2d16f8
commit 3a09455e6c
4 changed files with 5 additions and 14 deletions

View File

@@ -155,10 +155,6 @@ SHAMapItem::SHAMapItem(const uint256& tag, const std::vector<unsigned char>& dat
: mTag(tag), mData(data)
{ ; }
SHAMapItem::SHAMapItem(const uint160& tag, const std::vector<unsigned char>& data)
: mTag(tag.to256()), mData(data)
{ ; }
SHAMapItem::pointer SHAMap::firstBelow(SHAMapTreeNode::pointer node)
{
// Return the first item below this node

View File

@@ -99,8 +99,6 @@ public:
SHAMapItem(const uint256& tag, const std::vector<unsigned char>& data);
SHAMapItem(const std::vector<unsigned char>& data); // tag by hash
SHAMapItem(const uint160& tag, const std::vector<unsigned char>& data); // deprecated
const uint256& getTag() const { return mTag; }
std::vector<unsigned char> getData() const { return mData.getData(); }
const std::vector<unsigned char>& peekData() const { return mData.peekData(); }
@@ -286,9 +284,6 @@ public:
SHAMapItem::pointer peekNextItem(const uint256&);
SHAMapItem::pointer peekPrevItem(const uint256&);
SHAMapItem::pointer peekPrevItem(const uint160& u) { return peekPrevItem(u.to256()); }
SHAMapItem::pointer peekNextItem(const uint160& u) { return peekNextItem(u.to256()); }
// comparison/sync functions
void getMissingNodes(std::vector<SHAMapNode>& nodeIDs, std::vector<uint256>& hashes, int max);
bool getNodeFat(const SHAMapNode& node, std::vector<SHAMapNode>& nodeIDs,

View File

@@ -192,9 +192,9 @@ SHAMapTreeNode::SHAMapTreeNode(const SHAMapNode& id, const std::vector<unsigned
}
else if(type==1)
{ // account state
uint160 u;
s.get160(u, len-20);
s.chop(20);
uint256 u;
s.get256(u, len-32);
s.chop(256/8);
if(u.isZero()) throw SHAMapException(InvalidNode);
mItem=boost::make_shared<SHAMapItem>(u, s.peekData());
mType=tnACCOUNT_STATE;
@@ -236,7 +236,7 @@ void SHAMapTreeNode::addRaw(Serializer &s)
if(mType==tnACCOUNT_STATE)
{
mItem->addRaw(s);
s.add160(mItem->getTag().to160());
s.add256(mItem->getTag());
s.add8(1);
return;
}

View File

@@ -313,7 +313,7 @@ static SHAMapItem::pointer makeRandomAS()
Serializer s;
for(int d=0; d<3; d++)
s.add32(rand());
return boost::make_shared<SHAMapItem>(s.getRIPEMD160(), s.peekData());
return boost::make_shared<SHAMapItem>(s.getRIPEMD160().to256(), s.peekData());
}
static bool confuseMap(SHAMap &map, int count)