Start to flesh out this code.

This commit is contained in:
JoelKatz
2011-11-12 14:12:38 -08:00
parent 3f8f7789b3
commit 53b61d4d65
2 changed files with 68 additions and 13 deletions

41
SHAMap.cpp Normal file
View File

@@ -0,0 +1,41 @@
#include "BitcoinUtil.h"
#include "SHAMap.h"
bool SHAMapNodeID::operator<(const SHAMapNodeID &s) const
{
if(s.mDepth<mDepth) return true;
if(s.mDepth>mDepth) return false;
return mNodeID<s.mNodeID;
}
bool SHAMapNodeID::operator>(const SHAMapNodeID &s) const
{
if(s.mDepth<mDepth) return false;
if(s.mDepth>mDepth) return true;
return mNodeID>s.mNodeID;
}
bool SHAMapNodeID::operator<=(const SHAMapNodeID &s) const
{
if(s.mDepth<mDepth) return true;
if(s.mDepth>mDepth) return false;
return mNodeID<=s.mNodeID;
}
bool SHAMapNodeID::operator>=(const SHAMapNodeID &s) const
{
if(s.mDepth<mDepth) return false;
if(s.mDepth>mDepth) return true;
return mNodeID>=s.mNodeID;
}
bool SHAMapNodeID::operator==(const SHAMapNodeID &s) const
{
return (s.mDepth==mDepth) && (s.mNodeID==mNodeID);
}
bool SHAMapNodeID::operator!=(const SHAMapNodeID &s) const
{
return (s.mDepth!=mDepth) || (s.mNodeID!=mNodeID);
}