mirror of
https://github.com/XRPLF/rippled.git
synced 2025-12-06 17:27:55 +00:00
Add opperator==() for PathNodes.
This commit is contained in:
@@ -27,6 +27,14 @@ std::size_t hash_value(const aciSource& asValue)
|
|||||||
return seed;
|
return seed;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Compare the non-calculated fields.
|
||||||
|
bool PaymentNode::operator==(const PaymentNode& pnOther) const {
|
||||||
|
return pnOther.uFlags == uFlags
|
||||||
|
&& pnOther.uAccountID == uAccountID
|
||||||
|
&& pnOther.uCurrencyID == uCurrencyID
|
||||||
|
&& pnOther.uIssuerID == uIssuerID;
|
||||||
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// PathState implementation
|
// PathState implementation
|
||||||
//
|
//
|
||||||
@@ -272,6 +280,8 @@ TER PathState::pushNode(
|
|||||||
return terResult;
|
return terResult;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Set to an expanded path.
|
||||||
|
//
|
||||||
// terStatus = tesSUCCESS, temBAD_PATH, terNO_LINE, or temBAD_PATH_LOOP
|
// terStatus = tesSUCCESS, temBAD_PATH, terNO_LINE, or temBAD_PATH_LOOP
|
||||||
void PathState::setExpanded(
|
void PathState::setExpanded(
|
||||||
const LedgerEntrySet& lesSource,
|
const LedgerEntrySet& lesSource,
|
||||||
@@ -428,6 +438,7 @@ cLog(lsDEBUG) << boost::str(boost::format("PathState: receiver implied: account=
|
|||||||
% getJson());
|
% getJson());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Set to a canonical path.
|
||||||
void PathState::setCanonical(
|
void PathState::setCanonical(
|
||||||
const PathState& psExpanded
|
const PathState& psExpanded
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -53,6 +53,9 @@ protected:
|
|||||||
STAmount saOfferFunds;
|
STAmount saOfferFunds;
|
||||||
STAmount saTakerPays;
|
STAmount saTakerPays;
|
||||||
STAmount saTakerGets;
|
STAmount saTakerGets;
|
||||||
|
|
||||||
|
public:
|
||||||
|
bool operator==(const PaymentNode& pnOther) const;
|
||||||
};
|
};
|
||||||
|
|
||||||
// account id, currency id, issuer id :: node
|
// account id, currency id, issuer id :: node
|
||||||
|
|||||||
Reference in New Issue
Block a user