diff --git a/src/ripple/protocol/STPathSet.h b/src/ripple/protocol/STPathSet.h index c1d3c1c9e2..82d4f31974 100644 --- a/src/ripple/protocol/STPathSet.h +++ b/src/ripple/protocol/STPathSet.h @@ -24,6 +24,8 @@ #include #include #include +#include +#include #include namespace ripple { @@ -48,6 +50,40 @@ private: get_hash (STPathElement const& element); public: + STPathElement( + boost::optional const& account, + boost::optional const& currency, + boost::optional const& issuer) + : mType (typeNone) + { + if (! account) + { + is_offer_ = true; + } + else + { + is_offer_ = false; + mAccountID = *account; + mType |= typeAccount; + assert(mAccountID != noAccount()); + } + + if (currency) + { + mCurrencyID = *currency; + mType |= typeCurrency; + } + + if (issuer) + { + mIssuerID = *issuer; + mType |= typeIssuer; + assert(mIssuerID != noAccount()); + } + + hash_value_ = get_hash (*this); + } + STPathElement ( AccountID const& account, Currency const& currency, AccountID const& issuer, bool forceCurrency = false)