mirror of
https://github.com/XRPLF/rippled.git
synced 2025-11-20 02:55:50 +00:00
Make hasSeen consider all elements of a path element.
This commit is contained in:
@@ -415,16 +415,20 @@ bool STPathSet::isEquivalent(const SerializedType& t) const
|
||||
return v && (value == v->value);
|
||||
}
|
||||
|
||||
bool STPath::hasSeen(const uint160 &acct) {
|
||||
|
||||
for (int i = 0; i < mPath.size();i++) {
|
||||
bool STPath::hasSeen(const uint160 &uAccountId, const uint160& uCurrencyID, const uint160& uIssuerID)
|
||||
{
|
||||
for (int i = 0; i < mPath.size(); ++i) {
|
||||
STPathElement ele = getElement(i);
|
||||
if (ele.getAccountID() == acct)
|
||||
|
||||
if (ele.getAccountID() == uAccountId
|
||||
&& ele.getCurrency() == uCurrencyID
|
||||
&& ele.getIssuerID() == uIssuerID)
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
int STPath::getSerializeSize() const
|
||||
{
|
||||
int iBytes = 0;
|
||||
|
||||
@@ -623,7 +623,7 @@ public:
|
||||
const STPathElement& getElement(int offset) { return mPath[offset]; }
|
||||
void addElement(const STPathElement &e) { mPath.push_back(e); }
|
||||
void clear() { mPath.clear(); }
|
||||
bool hasSeen(const uint160 &acct);
|
||||
bool hasSeen(const uint160 &uAccountId, const uint160& uCurrencyID, const uint160& uIssuerID);
|
||||
int getSerializeSize() const;
|
||||
// std::string getText() const;
|
||||
Json::Value getJson(int) const;
|
||||
|
||||
Reference in New Issue
Block a user