Make hasSeen consider all elements of a path element.

This commit is contained in:
Arthur Britto
2013-02-04 15:39:53 -08:00
parent db83d90f05
commit acff2f45f1
2 changed files with 9 additions and 5 deletions

View File

@@ -415,16 +415,20 @@ bool STPathSet::isEquivalent(const SerializedType& t) const
return v && (value == v->value); return v && (value == v->value);
} }
bool STPath::hasSeen(const uint160 &acct) { bool STPath::hasSeen(const uint160 &uAccountId, const uint160& uCurrencyID, const uint160& uIssuerID)
{
for (int i = 0; i < mPath.size();i++) { for (int i = 0; i < mPath.size(); ++i) {
STPathElement ele = getElement(i); STPathElement ele = getElement(i);
if (ele.getAccountID() == acct)
if (ele.getAccountID() == uAccountId
&& ele.getCurrency() == uCurrencyID
&& ele.getIssuerID() == uIssuerID)
return true; return true;
} }
return false; return false;
} }
int STPath::getSerializeSize() const int STPath::getSerializeSize() const
{ {
int iBytes = 0; int iBytes = 0;

View File

@@ -623,7 +623,7 @@ public:
const STPathElement& getElement(int offset) { return mPath[offset]; } const STPathElement& getElement(int offset) { return mPath[offset]; }
void addElement(const STPathElement &e) { mPath.push_back(e); } void addElement(const STPathElement &e) { mPath.push_back(e); }
void clear() { mPath.clear(); } void clear() { mPath.clear(); }
bool hasSeen(const uint160 &acct); bool hasSeen(const uint160 &uAccountId, const uint160& uCurrencyID, const uint160& uIssuerID);
int getSerializeSize() const; int getSerializeSize() const;
// std::string getText() const; // std::string getText() const;
Json::Value getJson(int) const; Json::Value getJson(int) const;