mirror of
https://github.com/XRPLF/rippled.git
synced 2025-11-27 06:25:51 +00:00
Rename uIndex to uNode.
This commit is contained in:
@@ -28,13 +28,13 @@ std::size_t hash_value(const aciSource& asValue)
|
||||
// - Set bEntryAdvance to advance to next entry.
|
||||
// <-- uOfferIndex : 0=end of list.
|
||||
TER RippleCalc::calcNodeAdvance(
|
||||
const unsigned int uIndex, // 0 < uIndex < uLast
|
||||
const unsigned int uNode, // 0 < uNode < uLast
|
||||
PathState::ref pspCur,
|
||||
const bool bMultiQuality,
|
||||
const bool bReverse)
|
||||
{
|
||||
PaymentNode& pnPrv = pspCur->vpnNodes[uIndex-1];
|
||||
PaymentNode& pnCur = pspCur->vpnNodes[uIndex];
|
||||
PaymentNode& pnPrv = pspCur->vpnNodes[uNode-1];
|
||||
PaymentNode& pnCur = pspCur->vpnNodes[uNode];
|
||||
|
||||
const uint160& uPrvCurrencyID = pnPrv.uCurrencyID;
|
||||
const uint160& uPrvIssuerID = pnPrv.uIssuerID;
|
||||
@@ -181,7 +181,7 @@ TER RippleCalc::calcNodeAdvance(
|
||||
curIssuerNodeConstIterator itForward = pspCur->umForward.find(asLine);
|
||||
const bool bFoundForward = itForward != pspCur->umForward.end();
|
||||
|
||||
if (bFoundForward && itForward->second != uIndex)
|
||||
if (bFoundForward && itForward->second != uNode)
|
||||
{
|
||||
// Temporarily unfunded. Another node uses this source, ignore in this offer.
|
||||
cLog(lsINFO) << "calcNodeAdvance: temporarily unfunded offer (forward)";
|
||||
@@ -193,7 +193,7 @@ TER RippleCalc::calcNodeAdvance(
|
||||
curIssuerNodeConstIterator itPast = mumSource.find(asLine);
|
||||
bool bFoundPast = itPast != mumSource.end();
|
||||
|
||||
if (bFoundPast && itPast->second != uIndex)
|
||||
if (bFoundPast && itPast->second != uNode)
|
||||
{
|
||||
// Temporarily unfunded. Another node uses this source, ignore in this offer.
|
||||
cLog(lsINFO) << "calcNodeAdvance: temporarily unfunded offer (past)";
|
||||
@@ -205,7 +205,7 @@ TER RippleCalc::calcNodeAdvance(
|
||||
curIssuerNodeConstIterator itReverse = pspCur->umReverse.find(asLine);
|
||||
bool bFoundReverse = itReverse != pspCur->umReverse.end();
|
||||
|
||||
if (bFoundReverse && itReverse->second != uIndex)
|
||||
if (bFoundReverse && itReverse->second != uNode)
|
||||
{
|
||||
// Temporarily unfunded. Another node uses this source, ignore in this offer.
|
||||
cLog(lsINFO) << "calcNodeAdvance: temporarily unfunded offer (reverse)";
|
||||
@@ -245,7 +245,7 @@ TER RippleCalc::calcNodeAdvance(
|
||||
% STAmount::createHumanCurrency(uCurCurrencyID)
|
||||
% RippleAddress::createHumanAccountID(uCurIssuerID));
|
||||
|
||||
pspCur->umReverse.insert(std::make_pair(asLine, uIndex));
|
||||
pspCur->umReverse.insert(std::make_pair(asLine, uNode));
|
||||
}
|
||||
|
||||
bFundsDirty = false;
|
||||
@@ -270,7 +270,7 @@ TER RippleCalc::calcNodeAdvance(
|
||||
// requirements to the previous node. The previous node adjusts the amount output and the amount spent on fees. Continue process
|
||||
// till request is satisified while we the rate does not increase past the initial rate.
|
||||
TER RippleCalc::calcNodeDeliverRev(
|
||||
const unsigned int uIndex, // 0 < uIndex < uLast
|
||||
const unsigned int uNode, // 0 < uNode < uLast
|
||||
PathState::ref pspCur,
|
||||
const bool bMultiQuality,
|
||||
const uint160& uOutAccountID, // --> Output owner's account.
|
||||
@@ -279,8 +279,8 @@ TER RippleCalc::calcNodeDeliverRev(
|
||||
{
|
||||
TER terResult = tesSUCCESS;
|
||||
|
||||
PaymentNode& pnPrv = pspCur->vpnNodes[uIndex-1];
|
||||
PaymentNode& pnCur = pspCur->vpnNodes[uIndex];
|
||||
PaymentNode& pnPrv = pspCur->vpnNodes[uNode-1];
|
||||
PaymentNode& pnCur = pspCur->vpnNodes[uNode];
|
||||
|
||||
const uint160& uCurIssuerID = pnCur.uIssuerID;
|
||||
const uint160& uPrvAccountID = pnPrv.uAccountID;
|
||||
@@ -308,7 +308,7 @@ TER RippleCalc::calcNodeDeliverRev(
|
||||
STAmount& saTakerGets = pnCur.saTakerGets;
|
||||
STAmount& saRateMax = pnCur.saRateMax;
|
||||
|
||||
terResult = calcNodeAdvance(uIndex, pspCur, bMultiQuality, true); // If needed, advance to next funded offer.
|
||||
terResult = calcNodeAdvance(uNode, pspCur, bMultiQuality, true); // If needed, advance to next funded offer.
|
||||
|
||||
if (tesSUCCESS != terResult || !uOfferIndex)
|
||||
{
|
||||
@@ -413,7 +413,7 @@ TER RippleCalc::calcNodeDeliverRev(
|
||||
// Chain and compute the previous offer now.
|
||||
|
||||
terResult = calcNodeDeliverRev(
|
||||
uIndex-1,
|
||||
uNode-1,
|
||||
pspCur,
|
||||
bMultiQuality,
|
||||
uOfrOwnerID,
|
||||
@@ -474,7 +474,7 @@ TER RippleCalc::calcNodeDeliverRev(
|
||||
// Deliver maximum amount of funds from previous node.
|
||||
// Goal: Make progress consuming the offer.
|
||||
TER RippleCalc::calcNodeDeliverFwd(
|
||||
const unsigned int uIndex, // 0 < uIndex < uLast
|
||||
const unsigned int uNode, // 0 < uNode < uLast
|
||||
PathState::ref pspCur,
|
||||
const bool bMultiQuality,
|
||||
const uint160& uInAccountID, // --> Input owner's account.
|
||||
@@ -485,9 +485,9 @@ TER RippleCalc::calcNodeDeliverFwd(
|
||||
{
|
||||
TER terResult = tesSUCCESS;
|
||||
|
||||
PaymentNode& pnPrv = pspCur->vpnNodes[uIndex-1];
|
||||
PaymentNode& pnCur = pspCur->vpnNodes[uIndex];
|
||||
PaymentNode& pnNxt = pspCur->vpnNodes[uIndex+1];
|
||||
PaymentNode& pnPrv = pspCur->vpnNodes[uNode-1];
|
||||
PaymentNode& pnCur = pspCur->vpnNodes[uNode];
|
||||
PaymentNode& pnNxt = pspCur->vpnNodes[uNode+1];
|
||||
|
||||
const uint160& uNxtAccountID = pnNxt.uAccountID;
|
||||
const uint160& uCurIssuerID = pnCur.uIssuerID;
|
||||
@@ -507,7 +507,7 @@ TER RippleCalc::calcNodeDeliverFwd(
|
||||
&& saInAct != saInReq // Did not deliver limit.
|
||||
&& saInAct + saInFees != saInFunds) // Did not deliver all funds.
|
||||
{
|
||||
terResult = calcNodeAdvance(uIndex, pspCur, bMultiQuality, false); // If needed, advance to next funded offer.
|
||||
terResult = calcNodeAdvance(uNode, pspCur, bMultiQuality, false); // If needed, advance to next funded offer.
|
||||
|
||||
if (tesSUCCESS == terResult)
|
||||
{
|
||||
@@ -570,7 +570,7 @@ TER RippleCalc::calcNodeDeliverFwd(
|
||||
STAmount saOutPassFees;
|
||||
|
||||
terResult = RippleCalc::calcNodeDeliverFwd(
|
||||
uIndex+1,
|
||||
uNode+1,
|
||||
pspCur,
|
||||
bMultiQuality,
|
||||
uOfrOwnerID,
|
||||
@@ -628,14 +628,14 @@ TER RippleCalc::calcNodeDeliverFwd(
|
||||
|
||||
// Called to drive from the last offer node in a chain.
|
||||
TER RippleCalc::calcNodeOfferRev(
|
||||
const unsigned int uIndex, // 0 < uIndex < uLast
|
||||
const unsigned int uNode, // 0 < uNode < uLast
|
||||
PathState::ref pspCur,
|
||||
const bool bMultiQuality)
|
||||
{
|
||||
TER terResult;
|
||||
|
||||
PaymentNode& pnCur = pspCur->vpnNodes[uIndex];
|
||||
PaymentNode& pnNxt = pspCur->vpnNodes[uIndex+1];
|
||||
PaymentNode& pnCur = pspCur->vpnNodes[uNode];
|
||||
PaymentNode& pnNxt = pspCur->vpnNodes[uNode+1];
|
||||
|
||||
if (!!pnNxt.uAccountID)
|
||||
{
|
||||
@@ -643,7 +643,7 @@ TER RippleCalc::calcNodeOfferRev(
|
||||
STAmount saDeliverAct;
|
||||
|
||||
terResult = calcNodeDeliverRev(
|
||||
uIndex,
|
||||
uNode,
|
||||
pspCur,
|
||||
bMultiQuality,
|
||||
|
||||
@@ -668,13 +668,13 @@ TER RippleCalc::calcNodeOfferRev(
|
||||
// - Payout to issuer or limbo.
|
||||
// - Deliver is set without transfer fees.
|
||||
TER RippleCalc::calcNodeOfferFwd(
|
||||
const unsigned int uIndex, // 0 < uIndex < uLast
|
||||
const unsigned int uNode, // 0 < uNode < uLast
|
||||
PathState::ref pspCur,
|
||||
const bool bMultiQuality
|
||||
)
|
||||
{
|
||||
TER terResult;
|
||||
PaymentNode& pnPrv = pspCur->vpnNodes[uIndex-1];
|
||||
PaymentNode& pnPrv = pspCur->vpnNodes[uNode-1];
|
||||
|
||||
if (!!pnPrv.uAccountID)
|
||||
{
|
||||
@@ -683,7 +683,7 @@ TER RippleCalc::calcNodeOfferFwd(
|
||||
STAmount saInFees;
|
||||
|
||||
terResult = calcNodeDeliverFwd(
|
||||
uIndex,
|
||||
uNode,
|
||||
pspCur,
|
||||
bMultiQuality,
|
||||
pnPrv.uAccountID,
|
||||
@@ -822,20 +822,20 @@ void RippleCalc::calcNodeRipple(
|
||||
// Issues are limited based on credit limits and amount owed.
|
||||
// No account balance adjustments as we don't know how much is going to actually be pushed through yet.
|
||||
// <-- tesSUCCESS or tepPATH_DRY
|
||||
TER RippleCalc::calcNodeAccountRev(const unsigned int uIndex, PathState::ref pspCur, const bool bMultiQuality)
|
||||
TER RippleCalc::calcNodeAccountRev(const unsigned int uNode, PathState::ref pspCur, const bool bMultiQuality)
|
||||
{
|
||||
TER terResult = tesSUCCESS;
|
||||
const unsigned int uLast = pspCur->vpnNodes.size() - 1;
|
||||
|
||||
uint64 uRateMax = 0;
|
||||
|
||||
PaymentNode& pnPrv = pspCur->vpnNodes[uIndex ? uIndex-1 : 0];
|
||||
PaymentNode& pnCur = pspCur->vpnNodes[uIndex];
|
||||
PaymentNode& pnNxt = pspCur->vpnNodes[uIndex == uLast ? uLast : uIndex+1];
|
||||
PaymentNode& pnPrv = pspCur->vpnNodes[uNode ? uNode-1 : 0];
|
||||
PaymentNode& pnCur = pspCur->vpnNodes[uNode];
|
||||
PaymentNode& pnNxt = pspCur->vpnNodes[uNode == uLast ? uLast : uNode+1];
|
||||
|
||||
// Current is allowed to redeem to next.
|
||||
const bool bPrvAccount = !uIndex || isSetBit(pnPrv.uFlags, STPathElement::typeAccount);
|
||||
const bool bNxtAccount = uIndex == uLast || isSetBit(pnNxt.uFlags, STPathElement::typeAccount);
|
||||
const bool bPrvAccount = !uNode || isSetBit(pnPrv.uFlags, STPathElement::typeAccount);
|
||||
const bool bNxtAccount = uNode == uLast || isSetBit(pnNxt.uFlags, STPathElement::typeAccount);
|
||||
|
||||
const uint160& uCurAccountID = pnCur.uAccountID;
|
||||
const uint160& uPrvAccountID = bPrvAccount ? pnPrv.uAccountID : uCurAccountID;
|
||||
@@ -843,24 +843,24 @@ TER RippleCalc::calcNodeAccountRev(const unsigned int uIndex, PathState::ref psp
|
||||
|
||||
const uint160& uCurrencyID = pnCur.uCurrencyID;
|
||||
|
||||
const uint32 uQualityIn = uIndex ? lesActive.rippleQualityIn(uCurAccountID, uPrvAccountID, uCurrencyID) : QUALITY_ONE;
|
||||
const uint32 uQualityOut = uIndex != uLast ? lesActive.rippleQualityOut(uCurAccountID, uNxtAccountID, uCurrencyID) : QUALITY_ONE;
|
||||
const uint32 uQualityIn = uNode ? lesActive.rippleQualityIn(uCurAccountID, uPrvAccountID, uCurrencyID) : QUALITY_ONE;
|
||||
const uint32 uQualityOut = uNode != uLast ? lesActive.rippleQualityOut(uCurAccountID, uNxtAccountID, uCurrencyID) : QUALITY_ONE;
|
||||
|
||||
// For bPrvAccount
|
||||
const STAmount saPrvOwed = bPrvAccount && uIndex // Previous account is owed.
|
||||
const STAmount saPrvOwed = bPrvAccount && uNode // Previous account is owed.
|
||||
? lesActive.rippleOwed(uCurAccountID, uPrvAccountID, uCurrencyID)
|
||||
: STAmount(uCurrencyID, uCurAccountID);
|
||||
|
||||
const STAmount saPrvLimit = bPrvAccount && uIndex // Previous account may owe.
|
||||
const STAmount saPrvLimit = bPrvAccount && uNode // Previous account may owe.
|
||||
? lesActive.rippleLimit(uCurAccountID, uPrvAccountID, uCurrencyID)
|
||||
: STAmount(uCurrencyID, uCurAccountID);
|
||||
|
||||
const STAmount saNxtOwed = bNxtAccount && uIndex != uLast // Next account is owed.
|
||||
const STAmount saNxtOwed = bNxtAccount && uNode != uLast // Next account is owed.
|
||||
? lesActive.rippleOwed(uCurAccountID, uNxtAccountID, uCurrencyID)
|
||||
: STAmount(uCurrencyID, uCurAccountID);
|
||||
|
||||
cLog(lsINFO) << boost::str(boost::format("calcNodeAccountRev> uIndex=%d/%d uPrvAccountID=%s uCurAccountID=%s uNxtAccountID=%s uCurrencyID=%s uQualityIn=%d uQualityOut=%d saPrvOwed=%s saPrvLimit=%s")
|
||||
% uIndex
|
||||
cLog(lsINFO) << boost::str(boost::format("calcNodeAccountRev> uNode=%d/%d uPrvAccountID=%s uCurAccountID=%s uNxtAccountID=%s uCurrencyID=%s uQualityIn=%d uQualityOut=%d saPrvOwed=%s saPrvLimit=%s")
|
||||
% uNode
|
||||
% uLast
|
||||
% RippleAddress::createHumanAccountID(uPrvAccountID)
|
||||
% RippleAddress::createHumanAccountID(uCurAccountID)
|
||||
@@ -910,13 +910,13 @@ TER RippleCalc::calcNodeAccountRev(const unsigned int uIndex, PathState::ref psp
|
||||
|
||||
if (bPrvAccount && bNxtAccount)
|
||||
{
|
||||
if (!uIndex)
|
||||
if (!uNode)
|
||||
{
|
||||
// ^ --> ACCOUNT --> account|offer
|
||||
// Nothing to do, there is no previous to adjust.
|
||||
nothing();
|
||||
}
|
||||
else if (uIndex == uLast)
|
||||
else if (uNode == uLast)
|
||||
{
|
||||
// account --> ACCOUNT --> $
|
||||
// Overall deliverable.
|
||||
@@ -1081,7 +1081,7 @@ TER RippleCalc::calcNodeAccountRev(const unsigned int uIndex, PathState::ref psp
|
||||
{
|
||||
saPrvDeliverAct.zero(saCurRedeemReq);
|
||||
|
||||
if (uIndex == uLast)
|
||||
if (uNode == uLast)
|
||||
{
|
||||
// offer --> ACCOUNT --> $
|
||||
const STAmount& saCurWantedReq = bPrvAccount
|
||||
@@ -1166,7 +1166,7 @@ TER RippleCalc::calcNodeAccountRev(const unsigned int uIndex, PathState::ref psp
|
||||
// - Current node: specify what to push through to next.
|
||||
// - Output to next node is computed as input minus quality or transfer fee.
|
||||
TER RippleCalc::calcNodeAccountFwd(
|
||||
const unsigned int uIndex, // 0 <= uIndex <= uLast
|
||||
const unsigned int uNode, // 0 <= uNode <= uLast
|
||||
PathState::ref pspCur,
|
||||
const bool bMultiQuality)
|
||||
{
|
||||
@@ -1175,9 +1175,9 @@ TER RippleCalc::calcNodeAccountFwd(
|
||||
|
||||
uint64 uRateMax = 0;
|
||||
|
||||
PaymentNode& pnPrv = pspCur->vpnNodes[uIndex ? uIndex-1 : 0];
|
||||
PaymentNode& pnCur = pspCur->vpnNodes[uIndex];
|
||||
PaymentNode& pnNxt = pspCur->vpnNodes[uIndex == uLast ? uLast : uIndex+1];
|
||||
PaymentNode& pnPrv = pspCur->vpnNodes[uNode ? uNode-1 : 0];
|
||||
PaymentNode& pnCur = pspCur->vpnNodes[uNode];
|
||||
PaymentNode& pnNxt = pspCur->vpnNodes[uNode == uLast ? uLast : uNode+1];
|
||||
|
||||
const bool bPrvAccount = isSetBit(pnPrv.uFlags, STPathElement::typeAccount);
|
||||
const bool bNxtAccount = isSetBit(pnNxt.uFlags, STPathElement::typeAccount);
|
||||
@@ -1188,8 +1188,8 @@ TER RippleCalc::calcNodeAccountFwd(
|
||||
|
||||
const uint160& uCurrencyID = pnCur.uCurrencyID;
|
||||
|
||||
uint32 uQualityIn = uIndex ? lesActive.rippleQualityIn(uCurAccountID, uPrvAccountID, uCurrencyID) : QUALITY_ONE;
|
||||
uint32 uQualityOut = uIndex == uLast ? lesActive.rippleQualityOut(uCurAccountID, uNxtAccountID, uCurrencyID) : QUALITY_ONE;
|
||||
uint32 uQualityIn = uNode ? lesActive.rippleQualityIn(uCurAccountID, uPrvAccountID, uCurrencyID) : QUALITY_ONE;
|
||||
uint32 uQualityOut = uNode == uLast ? lesActive.rippleQualityOut(uCurAccountID, uNxtAccountID, uCurrencyID) : QUALITY_ONE;
|
||||
|
||||
// When looking backward (prv) for req we care about what we just calculated: use fwd
|
||||
// When looking forward (cur) for req we care about what was desired: use rev
|
||||
@@ -1216,8 +1216,8 @@ TER RippleCalc::calcNodeAccountFwd(
|
||||
const STAmount& saCurDeliverReq = pnCur.saRevDeliver;
|
||||
STAmount& saCurDeliverAct = pnCur.saFwdDeliver;
|
||||
|
||||
cLog(lsINFO) << boost::str(boost::format("calcNodeAccountFwd> uIndex=%d/%d saPrvRedeemReq=%s saPrvIssueReq=%s saPrvDeliverReq=%s saCurRedeemReq=%s saCurIssueReq=%s saCurDeliverReq=%s")
|
||||
% uIndex
|
||||
cLog(lsINFO) << boost::str(boost::format("calcNodeAccountFwd> uNode=%d/%d saPrvRedeemReq=%s saPrvIssueReq=%s saPrvDeliverReq=%s saCurRedeemReq=%s saCurIssueReq=%s saCurDeliverReq=%s")
|
||||
% uNode
|
||||
% uLast
|
||||
% saPrvRedeemReq.getFullText()
|
||||
% saPrvIssueReq.getFullText()
|
||||
@@ -1232,7 +1232,7 @@ TER RippleCalc::calcNodeAccountFwd(
|
||||
{
|
||||
// Next is an account, must be rippling.
|
||||
|
||||
if (!uIndex)
|
||||
if (!uNode)
|
||||
{
|
||||
// ^ --> ACCOUNT --> account
|
||||
|
||||
@@ -1274,7 +1274,7 @@ TER RippleCalc::calcNodeAccountFwd(
|
||||
% saCurIssueAct.getFullText()
|
||||
% saCurSendMaxPass.getFullText());
|
||||
}
|
||||
else if (uIndex == uLast)
|
||||
else if (uNode == uLast)
|
||||
{
|
||||
// account --> ACCOUNT --> $
|
||||
cLog(lsINFO) << boost::str(boost::format("calcNodeAccountFwd: account --> ACCOUNT --> $ : uPrvAccountID=%s uCurAccountID=%s saPrvRedeemReq=%s saPrvIssueReq=%s")
|
||||
@@ -1371,7 +1371,7 @@ TER RippleCalc::calcNodeAccountFwd(
|
||||
}
|
||||
else if (!bPrvAccount && bNxtAccount)
|
||||
{
|
||||
if (uIndex == uLast)
|
||||
if (uNode == uLast)
|
||||
{
|
||||
// offer --> ACCOUNT --> $
|
||||
cLog(lsINFO) << boost::str(boost::format("calcNodeAccountFwd: offer --> ACCOUNT --> $ : %s") % saPrvDeliverReq.getFullText());
|
||||
@@ -1761,16 +1761,16 @@ cLog(lsDEBUG) << boost::str(boost::format("PathState: implied: account=%s curren
|
||||
|
||||
const unsigned int uNodes = vpnNodes.size();
|
||||
|
||||
for (unsigned int uIndex = 0; tesSUCCESS == terStatus && uIndex != uNodes; ++uIndex)
|
||||
for (unsigned int uNode = 0; tesSUCCESS == terStatus && uNode != uNodes; ++uNode)
|
||||
{
|
||||
const PaymentNode& pnCur = vpnNodes[uIndex];
|
||||
const PaymentNode& pnCur = vpnNodes[uNode];
|
||||
|
||||
if (!!pnCur.uAccountID)
|
||||
{
|
||||
// Source is a ripple line
|
||||
nothing();
|
||||
}
|
||||
else if (!umForward.insert(std::make_pair(boost::make_tuple(pnCur.uAccountID, pnCur.uCurrencyID, pnCur.uIssuerID), uIndex)).second)
|
||||
else if (!umForward.insert(std::make_pair(boost::make_tuple(pnCur.uAccountID, pnCur.uCurrencyID, pnCur.uIssuerID), uNode)).second)
|
||||
{
|
||||
// Failed to insert. Have a loop.
|
||||
cLog(lsINFO) << boost::str(boost::format("PathState: loop detected: %s")
|
||||
@@ -1863,23 +1863,23 @@ Json::Value PathState::getJson() const
|
||||
return jvPathState;
|
||||
}
|
||||
|
||||
TER RippleCalc::calcNodeFwd(const unsigned int uIndex, PathState::ref pspCur, const bool bMultiQuality)
|
||||
TER RippleCalc::calcNodeFwd(const unsigned int uNode, PathState::ref pspCur, const bool bMultiQuality)
|
||||
{
|
||||
const PaymentNode& pnCur = pspCur->vpnNodes[uIndex];
|
||||
const PaymentNode& pnCur = pspCur->vpnNodes[uNode];
|
||||
const bool bCurAccount = isSetBit(pnCur.uFlags, STPathElement::typeAccount);
|
||||
|
||||
cLog(lsINFO) << boost::str(boost::format("calcNodeFwd> uIndex=%d") % uIndex);
|
||||
cLog(lsINFO) << boost::str(boost::format("calcNodeFwd> uNode=%d") % uNode);
|
||||
|
||||
TER terResult = bCurAccount
|
||||
? calcNodeAccountFwd(uIndex, pspCur, bMultiQuality)
|
||||
: calcNodeOfferFwd(uIndex, pspCur, bMultiQuality);
|
||||
? calcNodeAccountFwd(uNode, pspCur, bMultiQuality)
|
||||
: calcNodeOfferFwd(uNode, pspCur, bMultiQuality);
|
||||
|
||||
if (tesSUCCESS == terResult && uIndex + 1 != pspCur->vpnNodes.size())
|
||||
if (tesSUCCESS == terResult && uNode + 1 != pspCur->vpnNodes.size())
|
||||
{
|
||||
terResult = calcNodeFwd(uIndex+1, pspCur, bMultiQuality);
|
||||
terResult = calcNodeFwd(uNode+1, pspCur, bMultiQuality);
|
||||
}
|
||||
|
||||
cLog(lsINFO) << boost::str(boost::format("calcNodeFwd< uIndex=%d terResult=%d") % uIndex % terResult);
|
||||
cLog(lsINFO) << boost::str(boost::format("calcNodeFwd< uNode=%d terResult=%d") % uNode % terResult);
|
||||
|
||||
return terResult;
|
||||
}
|
||||
@@ -1893,9 +1893,9 @@ TER RippleCalc::calcNodeFwd(const unsigned int uIndex, PathState::ref pspCur, co
|
||||
// --> [all]saWanted.mCurrency
|
||||
// --> [all]saAccount
|
||||
// <-> [0]saWanted.mAmount : --> limit, <-- actual
|
||||
TER RippleCalc::calcNodeRev(const unsigned int uIndex, PathState::ref pspCur, const bool bMultiQuality)
|
||||
TER RippleCalc::calcNodeRev(const unsigned int uNode, PathState::ref pspCur, const bool bMultiQuality)
|
||||
{
|
||||
PaymentNode& pnCur = pspCur->vpnNodes[uIndex];
|
||||
PaymentNode& pnCur = pspCur->vpnNodes[uNode];
|
||||
const bool bCurAccount = isSetBit(pnCur.uFlags, STPathElement::typeAccount);
|
||||
TER terResult;
|
||||
|
||||
@@ -1905,14 +1905,14 @@ TER RippleCalc::calcNodeRev(const unsigned int uIndex, PathState::ref pspCur, co
|
||||
|
||||
saTransferRate = STAmount::saFromRate(lesActive.rippleTransferRate(uCurIssuerID));
|
||||
|
||||
cLog(lsINFO) << boost::str(boost::format("calcNodeRev> uIndex=%d uIssuerID=%s saTransferRate=%s")
|
||||
% uIndex
|
||||
cLog(lsINFO) << boost::str(boost::format("calcNodeRev> uNode=%d uIssuerID=%s saTransferRate=%s")
|
||||
% uNode
|
||||
% RippleAddress::createHumanAccountID(uCurIssuerID)
|
||||
% saTransferRate.getFullText());
|
||||
|
||||
terResult = bCurAccount
|
||||
? calcNodeAccountRev(uIndex, pspCur, bMultiQuality)
|
||||
: calcNodeOfferRev(uIndex, pspCur, bMultiQuality);
|
||||
? calcNodeAccountRev(uNode, pspCur, bMultiQuality)
|
||||
: calcNodeOfferRev(uNode, pspCur, bMultiQuality);
|
||||
|
||||
// Do previous.
|
||||
if (tesSUCCESS != terResult)
|
||||
@@ -1920,14 +1920,14 @@ TER RippleCalc::calcNodeRev(const unsigned int uIndex, PathState::ref pspCur, co
|
||||
// Error, don't continue.
|
||||
nothing();
|
||||
}
|
||||
else if (uIndex)
|
||||
else if (uNode)
|
||||
{
|
||||
// Continue in reverse.
|
||||
|
||||
terResult = calcNodeRev(uIndex-1, pspCur, bMultiQuality);
|
||||
terResult = calcNodeRev(uNode-1, pspCur, bMultiQuality);
|
||||
}
|
||||
|
||||
cLog(lsINFO) << boost::str(boost::format("calcNodeRev< uIndex=%d terResult=%s/%d") % uIndex % transToken(terResult) % terResult);
|
||||
cLog(lsINFO) << boost::str(boost::format("calcNodeRev< uNode=%d terResult=%s/%d") % uNode % transToken(terResult) % terResult);
|
||||
|
||||
return terResult;
|
||||
}
|
||||
|
||||
@@ -142,16 +142,16 @@ public:
|
||||
|
||||
PathState::pointer pathCreate(const STPath& spPath);
|
||||
void pathNext(PathState::ref pspCur, const int iPaths, const LedgerEntrySet& lesCheckpoint, LedgerEntrySet& lesCurrent);
|
||||
TER calcNode(const unsigned int uIndex, PathState::ref pspCur, const bool bMultiQuality);
|
||||
TER calcNodeRev(const unsigned int uIndex, PathState::ref pspCur, const bool bMultiQuality);
|
||||
TER calcNodeFwd(const unsigned int uIndex, PathState::ref pspCur, const bool bMultiQuality);
|
||||
TER calcNodeOfferRev(const unsigned int uIndex, PathState::ref pspCur, const bool bMultiQuality);
|
||||
TER calcNodeOfferFwd(const unsigned int uIndex, PathState::ref pspCur, const bool bMultiQuality);
|
||||
TER calcNodeAccountRev(const unsigned int uIndex, PathState::ref pspCur, const bool bMultiQuality);
|
||||
TER calcNodeAccountFwd(const unsigned int uIndex, PathState::ref pspCur, const bool bMultiQuality);
|
||||
TER calcNodeAdvance(const unsigned int uIndex, PathState::ref pspCur, const bool bMultiQuality, const bool bReverse);
|
||||
TER calcNode(const unsigned int uNode, PathState::ref pspCur, const bool bMultiQuality);
|
||||
TER calcNodeRev(const unsigned int uNode, PathState::ref pspCur, const bool bMultiQuality);
|
||||
TER calcNodeFwd(const unsigned int uNode, PathState::ref pspCur, const bool bMultiQuality);
|
||||
TER calcNodeOfferRev(const unsigned int uNode, PathState::ref pspCur, const bool bMultiQuality);
|
||||
TER calcNodeOfferFwd(const unsigned int uNode, PathState::ref pspCur, const bool bMultiQuality);
|
||||
TER calcNodeAccountRev(const unsigned int uNode, PathState::ref pspCur, const bool bMultiQuality);
|
||||
TER calcNodeAccountFwd(const unsigned int uNode, PathState::ref pspCur, const bool bMultiQuality);
|
||||
TER calcNodeAdvance(const unsigned int uNode, PathState::ref pspCur, const bool bMultiQuality, const bool bReverse);
|
||||
TER calcNodeDeliverRev(
|
||||
const unsigned int uIndex,
|
||||
const unsigned int uNode,
|
||||
PathState::ref pspCur,
|
||||
const bool bMultiQuality,
|
||||
const uint160& uOutAccountID,
|
||||
@@ -159,7 +159,7 @@ public:
|
||||
STAmount& saOutAct);
|
||||
|
||||
TER calcNodeDeliverFwd(
|
||||
const unsigned int uIndex,
|
||||
const unsigned int uNode,
|
||||
PathState::ref pspCur,
|
||||
const bool bMultiQuality,
|
||||
const uint160& uInAccountID,
|
||||
|
||||
Reference in New Issue
Block a user