Convert rvalue to an lvalue. (RIPD-494)

* The rvalue gets destructed as soon as "rc" is constructed.
This commit is contained in:
Edward Hennis
2014-08-19 17:14:19 -04:00
committed by Tom Ritchford
parent 8dd799aa6f
commit 2b69ded1ea

View File

@@ -270,13 +270,15 @@ STPathSet Pathfinder::filterPaths(int iMaxPaths, STPath& extraPath)
try
{
LedgerEntrySet lesSandbox (mLedger, tapNONE);
// Need a lvalue here. An rvalue will be destructed as soon as the RippleCalc ctor ends.
STPathSet spsPaths;
path::RippleCalc rc(
lesSandbox,
mSrcAmount,
mDstAmount,
mDstAccountID,
mSrcAccountID,
STPathSet ());
spsPaths);
rc.partialPaymentAllowed_ = true;
TER result = rc.rippleCalculate ();