mirror of
https://github.com/XRPLF/rippled.git
synced 2025-12-06 17:27:55 +00:00
Merge ripple dirs with owner dirs and RPC fixes for setting quality.
This commit is contained in:
@@ -265,9 +265,6 @@ public:
|
||||
static uint256 getRippleStateIndex(const uint160& uiA, const uint160& uiB, const uint160& uCurrency)
|
||||
{ return getRippleStateIndex(NewcoinAddress::createAccountID(uiA), NewcoinAddress::createAccountID(uiB), uCurrency); }
|
||||
|
||||
// Directory of lines indexed by an account (not all lines are indexed)
|
||||
static uint256 getRippleDirIndex(const uint160& uAccountID);
|
||||
|
||||
RippleState::pointer accessRippleState(const uint256& uNode);
|
||||
|
||||
SLE::pointer getRippleState(LedgerStateParms& parms, const uint256& uNode);
|
||||
|
||||
@@ -23,7 +23,6 @@ enum LedgerNameSpace
|
||||
spaceGenerator = 'g',
|
||||
spaceNickname = 'n',
|
||||
spaceRipple = 'r',
|
||||
spaceRippleDir = 'R',
|
||||
spaceOffer = 'o', // Entry for an offer.
|
||||
spaceOwnerDir = 'O', // Directory of things owned by an account.
|
||||
spaceBookDir = 'B', // Directory of order books.
|
||||
@@ -38,10 +37,6 @@ enum LedgerSpecificFlags
|
||||
|
||||
// ltOFFER
|
||||
lsfPassive = 0x00010000,
|
||||
|
||||
// ltRIPPLE_STATE
|
||||
lsfLowIndexed = 0x00010000,
|
||||
lsfHighIndexed = 0x00020000,
|
||||
};
|
||||
|
||||
struct LedgerEntryFormat
|
||||
|
||||
@@ -126,16 +126,6 @@ uint256 Ledger::getOwnerDirIndex(const uint160& uAccountID)
|
||||
return s.getSHA512Half();
|
||||
}
|
||||
|
||||
uint256 Ledger::getRippleDirIndex(const uint160& uAccountID)
|
||||
{
|
||||
Serializer s(22);
|
||||
|
||||
s.add16(spaceRippleDir); // 2
|
||||
s.add160(uAccountID); // 20
|
||||
|
||||
return s.getSHA512Half();
|
||||
}
|
||||
|
||||
uint256 Ledger::getRippleStateIndex(const NewcoinAddress& naA, const NewcoinAddress& naB, const uint160& uCurrency)
|
||||
{
|
||||
uint160 uAID = naA.getAccountID();
|
||||
|
||||
@@ -254,7 +254,7 @@ Json::Value NetworkOPs::getOwnerInfo(const uint256& uLedger, const NewcoinAddres
|
||||
|
||||
Json::Value NetworkOPs::getOwnerInfo(Ledger::pointer lpLedger, const NewcoinAddress& naAccount)
|
||||
{
|
||||
Json::Value jvObjects(Json::arrayValue);
|
||||
Json::Value jvObjects(Json::objectValue);
|
||||
|
||||
uint256 uRootIndex = lpLedger->getOwnerDirIndex(naAccount.getAccountID());
|
||||
|
||||
@@ -272,10 +272,32 @@ Json::Value NetworkOPs::getOwnerInfo(Ledger::pointer lpLedger, const NewcoinAddr
|
||||
|
||||
BOOST_FOREACH(const uint256& uDirEntry, vuiIndexes)
|
||||
{
|
||||
LedgerStateParms lspOffer = lepNONE;
|
||||
SLE::pointer sleOffer = lpLedger->getOffer(lspOffer, uDirEntry);
|
||||
SLE::pointer sleCur = lpLedger->getSLE(uDirEntry);
|
||||
|
||||
jvObjects.append(sleOffer->getJson(0));
|
||||
switch (sleCur->getType())
|
||||
{
|
||||
case ltOFFER:
|
||||
if (!jvObjects.isMember("offers"))
|
||||
jvObjects["offers"] = Json::Value(Json::arrayValue);
|
||||
|
||||
jvObjects["offers"].append(sleCur->getJson(0));
|
||||
break;
|
||||
|
||||
case ltRIPPLE_STATE:
|
||||
if (!jvObjects.isMember("ripple_lines"))
|
||||
jvObjects["ripple_lines"] = Json::Value(Json::arrayValue);
|
||||
|
||||
jvObjects["ripple_lines"].append(sleCur->getJson(0));
|
||||
break;
|
||||
|
||||
case ltACCOUNT_ROOT:
|
||||
case ltDIR_NODE:
|
||||
case ltGENERATOR_MAP:
|
||||
case ltNICKNAME:
|
||||
default:
|
||||
assert(false);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
uNodeDir = sleNode->getIFieldU64(sfIndexNext);
|
||||
|
||||
@@ -1151,22 +1151,12 @@ Json::Value RPCServer::doOwnerInfo(const Json::Value& params)
|
||||
uint256 uAccepted = mNetOps->getClosedLedger();
|
||||
Json::Value jAccepted = accountFromString(uAccepted, naAccount, bIndex, strIdent, iIndex);
|
||||
|
||||
if (jAccepted.empty())
|
||||
{
|
||||
jAccepted["offers"] = mNetOps->getOwnerInfo(uAccepted, naAccount);
|
||||
}
|
||||
|
||||
ret["accepted"] = jAccepted;
|
||||
ret["accepted"] = jAccepted.empty() ? mNetOps->getOwnerInfo(uAccepted, naAccount) : jAccepted;
|
||||
|
||||
uint256 uCurrent = mNetOps->getCurrentLedger();
|
||||
Json::Value jCurrent = accountFromString(uCurrent, naAccount, bIndex, strIdent, iIndex);
|
||||
|
||||
if (jCurrent.empty())
|
||||
{
|
||||
jCurrent["offers"] = mNetOps->getOwnerInfo(uCurrent, naAccount);
|
||||
}
|
||||
|
||||
ret["current"] = jCurrent;
|
||||
ret["current"] = jCurrent.empty() ? mNetOps->getOwnerInfo(uCurrent, naAccount) : jCurrent;
|
||||
|
||||
return ret;
|
||||
}
|
||||
@@ -1677,6 +1667,8 @@ Json::Value RPCServer::doRippleLinesGet(const Json::Value ¶ms)
|
||||
jPeer["currency"] = saBalance.getHumanCurrency();
|
||||
jPeer["limit"] = saLimit.getText();
|
||||
jPeer["limit_peer"] = saLimitPeer.getText();
|
||||
jPeer["quality_in"] = static_cast<Json::UInt>(line->getQualityIn());
|
||||
jPeer["quality_out"] = static_cast<Json::UInt>(line->getQualityOut());
|
||||
|
||||
jsonLines.append(jPeer);
|
||||
}
|
||||
|
||||
@@ -15,18 +15,22 @@ RippleLines::RippleLines(const uint160& accountID )
|
||||
|
||||
void RippleLines::fillLines(const uint160& accountID, Ledger::pointer ledger)
|
||||
{
|
||||
uint256 rootIndex = Ledger::getRippleDirIndex(accountID);
|
||||
uint256 rootIndex = Ledger::getOwnerDirIndex(accountID);
|
||||
uint256 currentIndex = rootIndex;
|
||||
|
||||
LedgerStateParms lspNode = lepNONE;
|
||||
|
||||
while (1)
|
||||
{
|
||||
SerializedLedgerEntry::pointer rippleDir=ledger->getDirNode(lspNode,currentIndex);
|
||||
SLE::pointer rippleDir=ledger->getDirNode(lspNode, currentIndex);
|
||||
if (!rippleDir) return;
|
||||
|
||||
STVector256 svRippleNodes = rippleDir->getIFieldV256(sfIndexes);
|
||||
BOOST_FOREACH(uint256& uNode, svRippleNodes.peekValue())
|
||||
STVector256 svOwnerNodes = rippleDir->getIFieldV256(sfIndexes);
|
||||
BOOST_FOREACH(uint256& uNode, svOwnerNodes.peekValue())
|
||||
{
|
||||
SLE::pointer sleCur = ledger->getSLE(uNode);
|
||||
|
||||
if (ltRIPPLE_STATE == sleCur->getType())
|
||||
{
|
||||
RippleState::pointer rsLine = ledger->accessRippleState(uNode);
|
||||
if (rsLine)
|
||||
@@ -39,6 +43,7 @@ void RippleLines::fillLines(const uint160& accountID, Ledger::pointer ledger)
|
||||
Log(lsWARNING) << "doRippleLinesGet: Bad index: " << uNode.ToString();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
uint64 uNodeNext = rippleDir->getIFieldU64(sfIndexNext);
|
||||
if (!uNodeNext) return;
|
||||
@@ -46,3 +51,4 @@ void RippleLines::fillLines(const uint160& accountID, Ledger::pointer ledger)
|
||||
currentIndex = Ledger::getDirNodeIndex(rootIndex, uNodeNext);
|
||||
}
|
||||
}
|
||||
// vim:ts=4
|
||||
|
||||
@@ -13,6 +13,12 @@ RippleState::RippleState(SerializedLedgerEntry::pointer ledgerEntry) :
|
||||
mLowLimit = mLedgerEntry->getIValueFieldAmount(sfLowLimit);
|
||||
mHighLimit = mLedgerEntry->getIValueFieldAmount(sfHighLimit);
|
||||
|
||||
mLowQualityIn = mLedgerEntry->getIFieldU32(sfLowQualityIn);
|
||||
mLowQualityOut = mLedgerEntry->getIFieldU32(sfLowQualityOut);
|
||||
|
||||
mHighQualityIn = mLedgerEntry->getIFieldU32(sfHighQualityIn);
|
||||
mHighQualityOut = mLedgerEntry->getIFieldU32(sfHighQualityOut);
|
||||
|
||||
mBalance = mLedgerEntry->getIValueFieldAmount(sfBalance);
|
||||
|
||||
mValid = true;
|
||||
|
||||
@@ -24,6 +24,11 @@ private:
|
||||
STAmount mLowLimit;
|
||||
STAmount mHighLimit;
|
||||
|
||||
uint64 mLowQualityIn;
|
||||
uint64 mLowQualityOut;
|
||||
uint64 mHighQualityIn;
|
||||
uint64 mHighQualityOut;
|
||||
|
||||
STAmount mBalance;
|
||||
|
||||
bool mValid;
|
||||
@@ -42,6 +47,9 @@ public:
|
||||
STAmount getLimit() const { return mViewLowest ? mLowLimit : mHighLimit; }
|
||||
STAmount getLimitPeer() const { return mViewLowest ? mHighLimit : mLowLimit; }
|
||||
|
||||
uint32 getQualityIn() const { return mViewLowest ? mLowQualityIn : mHighQualityIn; }
|
||||
uint32 getQualityOut() const { return mViewLowest ? mLowQualityOut : mHighQualityOut; }
|
||||
|
||||
SerializedLedgerEntry::pointer getSLE() { return mLedgerEntry; }
|
||||
const SerializedLedgerEntry& peekSLE() const { return *mLedgerEntry; }
|
||||
SerializedLedgerEntry& peekSLE() { return *mLedgerEntry; }
|
||||
|
||||
@@ -270,10 +270,10 @@ Transaction::pointer Transaction::setCreditSet(
|
||||
mTransaction->setITFieldAmount(sfLimitAmount, saLimitAmount);
|
||||
|
||||
if (bQualityIn)
|
||||
mTransaction->setITFieldU32(sfAcceptRate, uQualityIn);
|
||||
mTransaction->setITFieldU32(sfQualityIn, uQualityIn);
|
||||
|
||||
if (bQualityOut)
|
||||
mTransaction->setITFieldU32(sfAcceptRate, uQualityOut);
|
||||
mTransaction->setITFieldU32(sfQualityOut, uQualityOut);
|
||||
|
||||
sign(naPrivateKey);
|
||||
|
||||
|
||||
@@ -145,7 +145,7 @@ STAmount TransactionEngine::rippleLimit(const uint160& uToAccountID, const uint1
|
||||
|
||||
}
|
||||
|
||||
uint32 TransactionEngine::rippleTransfer(const uint160& uIssuerID)
|
||||
uint32 TransactionEngine::rippleTransferRate(const uint160& uIssuerID)
|
||||
{
|
||||
SLE::pointer sleAccount = entryCache(ltACCOUNT_ROOT, Ledger::getAccountRootIndex(uIssuerID));
|
||||
|
||||
@@ -298,13 +298,13 @@ STAmount TransactionEngine::accountFunds(const uint160& uAccountID, const STAmou
|
||||
}
|
||||
|
||||
// Calculate transit fee.
|
||||
STAmount TransactionEngine::rippleTransfer(const uint160& uSenderID, const uint160& uReceiverID, const uint160& uIssuerID, const STAmount& saAmount)
|
||||
STAmount TransactionEngine::rippleTransferFee(const uint160& uSenderID, const uint160& uReceiverID, const uint160& uIssuerID, const STAmount& saAmount)
|
||||
{
|
||||
STAmount saTransitFee;
|
||||
|
||||
if (uSenderID != uIssuerID && uReceiverID != uIssuerID)
|
||||
{
|
||||
uint32 uTransitRate = rippleTransfer(uIssuerID);
|
||||
uint32 uTransitRate = rippleTransferRate(uIssuerID);
|
||||
|
||||
if (QUALITY_ONE != uTransitRate)
|
||||
{
|
||||
@@ -380,7 +380,7 @@ STAmount TransactionEngine::rippleSend(const uint160& uSenderID, const uint160&
|
||||
{
|
||||
// Sending 3rd party IOUs: transit.
|
||||
|
||||
STAmount saTransitFee = rippleTransfer(uSenderID, uReceiverID, uIssuerID, saAmount);
|
||||
STAmount saTransitFee = rippleTransferFee(uSenderID, uReceiverID, uIssuerID, saAmount);
|
||||
|
||||
saActual = saTransitFee.isZero() ? saAmount : saAmount+saTransitFee;
|
||||
|
||||
@@ -1505,7 +1505,6 @@ TransactionEngineResult TransactionEngine::doCreditSet(const SerializedTransacti
|
||||
}
|
||||
|
||||
bool bFlipped = mTxnAccountID > uDstAccountID;
|
||||
uint32 uFlags = bFlipped ? lsfLowIndexed : lsfHighIndexed;
|
||||
bool bLimitAmount = txn.getITFieldPresent(sfLimitAmount);
|
||||
STAmount saLimitAmount = bLimitAmount ? txn.getITFieldAmount(sfLimitAmount) : STAmount();
|
||||
bool bQualityIn = txn.getITFieldPresent(sfQualityIn);
|
||||
@@ -1514,7 +1513,6 @@ TransactionEngineResult TransactionEngine::doCreditSet(const SerializedTransacti
|
||||
uint32 uQualityOut = bQualityIn ? txn.getITFieldU32(sfQualityOut) : 0;
|
||||
uint160 uCurrencyID = saLimitAmount.getCurrency();
|
||||
STAmount saBalance(uCurrencyID);
|
||||
bool bAddIndex = false;
|
||||
bool bDelIndex = false;
|
||||
|
||||
SLE::pointer sleRippleState = entryCache(ltRIPPLE_STATE, Ledger::getRippleStateIndex(mTxnAccountID, uDstAccountID, uCurrencyID));
|
||||
@@ -1540,7 +1538,7 @@ TransactionEngineResult TransactionEngine::doCreditSet(const SerializedTransacti
|
||||
// Zero balance and eliminating last limit.
|
||||
|
||||
bDelIndex = true;
|
||||
terResult = dirDelete(false, uSrcRef, Ledger::getRippleDirIndex(mTxnAccountID), sleRippleState->getIndex());
|
||||
terResult = dirDelete(false, uSrcRef, Ledger::getOwnerDirIndex(mTxnAccountID), sleRippleState->getIndex());
|
||||
}
|
||||
}
|
||||
#endif
|
||||
@@ -1576,15 +1574,10 @@ TransactionEngineResult TransactionEngine::doCreditSet(const SerializedTransacti
|
||||
sleRippleState->makeIFieldAbsent(bFlipped ? sfLowQualityOut : sfHighQualityOut);
|
||||
}
|
||||
|
||||
bAddIndex = !(sleRippleState->getFlags() & uFlags);
|
||||
|
||||
if (bAddIndex)
|
||||
sleRippleState->setFlag(uFlags);
|
||||
|
||||
entryModify(sleRippleState);
|
||||
}
|
||||
|
||||
Log(lsINFO) << "doCreditSet: Modifying ripple line: bAddIndex=" << bAddIndex << " bDelIndex=" << bDelIndex;
|
||||
Log(lsINFO) << "doCreditSet: Modifying ripple line: bDelIndex=" << bDelIndex;
|
||||
}
|
||||
// Line does not exist.
|
||||
else if (saLimitAmount.isZero())
|
||||
@@ -1598,12 +1591,10 @@ TransactionEngineResult TransactionEngine::doCreditSet(const SerializedTransacti
|
||||
// Create a new ripple line.
|
||||
STAmount saZero(uCurrencyID);
|
||||
|
||||
bAddIndex = true;
|
||||
sleRippleState = entryCreate(ltRIPPLE_STATE, Ledger::getRippleStateIndex(mTxnAccountID, uDstAccountID, uCurrencyID));
|
||||
|
||||
Log(lsINFO) << "doCreditSet: Creating ripple line: " << sleRippleState->getIndex().ToString();
|
||||
|
||||
sleRippleState->setFlag(uFlags);
|
||||
sleRippleState->setIFieldAmount(sfBalance, saZero); // Zero balance in currency.
|
||||
sleRippleState->setIFieldAmount(bFlipped ? sfHighLimit : sfLowLimit, saLimitAmount);
|
||||
sleRippleState->setIFieldAmount(bFlipped ? sfLowLimit : sfHighLimit, saZero);
|
||||
@@ -1613,14 +1604,13 @@ TransactionEngineResult TransactionEngine::doCreditSet(const SerializedTransacti
|
||||
sleRippleState->setIFieldU32(bFlipped ? sfLowQualityIn : sfHighQualityIn, uQualityIn);
|
||||
if (uQualityOut)
|
||||
sleRippleState->setIFieldU32(bFlipped ? sfLowQualityOut : sfHighQualityOut, uQualityOut);
|
||||
}
|
||||
|
||||
if (bAddIndex)
|
||||
{
|
||||
uint64 uSrcRef; // Ignored, ripple_state dirs never delete.
|
||||
uint64 uSrcRef; // Ignored, dirs never delete.
|
||||
|
||||
// XXX Make dirAdd more flexiable to take vector.
|
||||
terResult = dirAdd(uSrcRef, Ledger::getRippleDirIndex(mTxnAccountID), sleRippleState->getIndex());
|
||||
terResult = dirAdd(uSrcRef, Ledger::getOwnerDirIndex(mTxnAccountID), sleRippleState->getIndex());
|
||||
|
||||
if (terSUCCESS == terResult)
|
||||
terResult = dirAdd(uSrcRef, Ledger::getOwnerDirIndex(uDstAccountID), sleRippleState->getIndex());
|
||||
}
|
||||
|
||||
Log(lsINFO) << "doCreditSet<";
|
||||
@@ -1927,16 +1917,16 @@ bool TransactionEngine::calcNodeOfferRev(
|
||||
uint160& uNxtIssuerID = nxtPN.uIssuerID;
|
||||
uint160& uNxtAccountID = nxtPN.uAccountID;
|
||||
|
||||
STAmount saTransferRate = STAmount(CURRENCY_ONE, rippleTransfer(uCurIssuerID), -9);
|
||||
STAmount saTransferRate = STAmount(CURRENCY_ONE, rippleTransferRate(uCurIssuerID), -9);
|
||||
|
||||
uint256 uDirectTip = Ledger::getBookBase(uPrvCurrencyID, uPrvIssuerID, uCurCurrencyID, uCurIssuerID);
|
||||
uint256 uDirectEnd = Ledger::getQualityNext(uDirectTip);
|
||||
bool bAdvance = !entryCache(ltDIR_NODE, uDirectTip);
|
||||
|
||||
STAmount& saPrvDlvReq = prvPN.saRevDeliver;
|
||||
STAmount& saPrvDlvReq = prvPN.saRevDeliver; // To be adjusted.
|
||||
STAmount saPrvDlvAct;
|
||||
|
||||
STAmount& saCurDlvReq = curPN.saRevDeliver; // Reverse driver.
|
||||
const STAmount& saCurDlvReq = curPN.saRevDeliver; // Reverse driver.
|
||||
STAmount saCurDlvAct;
|
||||
|
||||
while (!!uDirectTip // Have a quality.
|
||||
@@ -2119,7 +2109,7 @@ bool TransactionEngine::calcNodeOfferFwd(
|
||||
uint160& uNxtIssuerID = nxtPN.uIssuerID;
|
||||
|
||||
uint160& uNxtAccountID = nxtPN.uAccountID;
|
||||
STAmount saTransferRate = STAmount(CURRENCY_ONE, rippleTransfer(uCurIssuerID), -9);
|
||||
STAmount saTransferRate = STAmount(CURRENCY_ONE, rippleTransferRate(uCurIssuerID), -9);
|
||||
|
||||
uint256 uDirectTip = Ledger::getBookBase(uPrvCurrencyID, uPrvIssuerID, uCurCurrencyID, uCurIssuerID);
|
||||
uint256 uDirectEnd = Ledger::getQualityNext(uDirectTip);
|
||||
@@ -2730,7 +2720,7 @@ bool TransactionEngine::calcNodeAccountRev(unsigned int uIndex, PathState::point
|
||||
// Rate : 1.0 : transfer_rate
|
||||
Log(lsINFO) << str(boost::format("calcNodeAccountRev: Rate : 1.0 : transfer_rate"));
|
||||
|
||||
calcNodeRipple(QUALITY_ONE, rippleTransfer(uCurAccountID), saPrvRedeemReq, saCurIssueReq, saPrvRedeemAct, saCurIssueAct);
|
||||
calcNodeRipple(QUALITY_ONE, rippleTransferRate(uCurAccountID), saPrvRedeemReq, saCurIssueReq, saPrvRedeemAct, saCurIssueAct);
|
||||
}
|
||||
|
||||
// issue (part 1)-> redeem
|
||||
@@ -2789,7 +2779,7 @@ bool TransactionEngine::calcNodeAccountRev(unsigned int uIndex, PathState::point
|
||||
&& saCurDeliverReq) // Need some issued.
|
||||
{
|
||||
// Rate : 1.0 : transfer_rate
|
||||
calcNodeRipple(QUALITY_ONE, rippleTransfer(uCurAccountID), saPrvRedeemReq, saCurDeliverReq, saPrvRedeemAct, saCurDeliverAct);
|
||||
calcNodeRipple(QUALITY_ONE, rippleTransferRate(uCurAccountID), saPrvRedeemReq, saCurDeliverReq, saPrvRedeemAct, saCurDeliverAct);
|
||||
}
|
||||
|
||||
// issue -> deliver/issue
|
||||
@@ -2848,7 +2838,7 @@ bool TransactionEngine::calcNodeAccountRev(unsigned int uIndex, PathState::point
|
||||
&& saCurIssueReq) // Need some issued.
|
||||
{
|
||||
// Rate : 1.0 : transfer_rate
|
||||
calcNodeRipple(QUALITY_ONE, rippleTransfer(uCurAccountID), saPrvDeliverReq, saCurIssueReq, saPrvDeliverAct, saCurIssueAct);
|
||||
calcNodeRipple(QUALITY_ONE, rippleTransferRate(uCurAccountID), saPrvDeliverReq, saCurIssueReq, saPrvDeliverAct, saCurIssueAct);
|
||||
}
|
||||
|
||||
if (!saCurDeliverAct && !saCurIssueAct)
|
||||
@@ -2869,7 +2859,7 @@ bool TransactionEngine::calcNodeAccountRev(unsigned int uIndex, PathState::point
|
||||
&& saCurDeliverReq != saCurDeliverAct) // Can only if issue if more can not be redeemed.
|
||||
{
|
||||
// Rate : 1.0 : transfer_rate
|
||||
calcNodeRipple(QUALITY_ONE, rippleTransfer(uCurAccountID), saPrvDeliverReq, saCurDeliverReq, saPrvDeliverAct, saCurDeliverAct);
|
||||
calcNodeRipple(QUALITY_ONE, rippleTransferRate(uCurAccountID), saPrvDeliverReq, saCurDeliverReq, saPrvDeliverAct, saCurDeliverAct);
|
||||
}
|
||||
|
||||
if (!saCurDeliverAct)
|
||||
@@ -3041,7 +3031,7 @@ bool TransactionEngine::calcNodeAccountFwd(unsigned int uIndex, PathState::point
|
||||
&& saCurIssueReq)
|
||||
{
|
||||
// Rate : 1.0 : transfer_rate
|
||||
calcNodeRipple(QUALITY_ONE, rippleTransfer(uCurAccountID), saPrvRedeemReq, saCurIssueReq, saPrvRedeemAct, saCurIssueAct);
|
||||
calcNodeRipple(QUALITY_ONE, rippleTransferRate(uCurAccountID), saPrvRedeemReq, saCurIssueReq, saPrvRedeemAct, saCurIssueAct);
|
||||
}
|
||||
|
||||
// Previous issue part 1: issue -> redeem
|
||||
@@ -3077,7 +3067,7 @@ bool TransactionEngine::calcNodeAccountFwd(unsigned int uIndex, PathState::point
|
||||
if (saPrvRedeemReq) // Previous wants to redeem.
|
||||
{
|
||||
// Rate : 1.0 : transfer_rate
|
||||
calcNodeRipple(QUALITY_ONE, rippleTransfer(uCurAccountID), saPrvRedeemReq, saCurDeliverReq, saPrvRedeemAct, saCurDeliverAct);
|
||||
calcNodeRipple(QUALITY_ONE, rippleTransferRate(uCurAccountID), saPrvRedeemReq, saCurDeliverReq, saPrvRedeemAct, saCurDeliverAct);
|
||||
}
|
||||
|
||||
// issue -> issue
|
||||
@@ -3125,7 +3115,7 @@ bool TransactionEngine::calcNodeAccountFwd(unsigned int uIndex, PathState::point
|
||||
&& saCurIssueReq) // Current wants issue.
|
||||
{
|
||||
// Rate : 1.0 : transfer_rate
|
||||
calcNodeRipple(QUALITY_ONE, rippleTransfer(uCurAccountID), saPrvRedeemReq, saCurIssueReq, saPrvRedeemAct, saCurIssueAct);
|
||||
calcNodeRipple(QUALITY_ONE, rippleTransferRate(uCurAccountID), saPrvRedeemReq, saCurIssueReq, saPrvRedeemAct, saCurIssueAct);
|
||||
}
|
||||
|
||||
// No income balance adjustments necessary. The paying side inside the offer paid and the next link will receive.
|
||||
@@ -3142,7 +3132,7 @@ bool TransactionEngine::calcNodeAccountFwd(unsigned int uIndex, PathState::point
|
||||
&& saCurIssueReq) // Current wants issue.
|
||||
{
|
||||
// Rate : 1.0 : transfer_rate
|
||||
calcNodeRipple(QUALITY_ONE, rippleTransfer(uCurAccountID), saPrvDeliverReq, saCurDeliverReq, saPrvDeliverAct, saCurDeliverAct);
|
||||
calcNodeRipple(QUALITY_ONE, rippleTransferRate(uCurAccountID), saPrvDeliverReq, saCurDeliverReq, saPrvDeliverAct, saCurDeliverAct);
|
||||
}
|
||||
|
||||
// No income balance adjustments necessary. The paying side inside the offer paid and the next link will receive.
|
||||
@@ -3742,7 +3732,7 @@ TransactionEngineResult TransactionEngine::doPayment(const SerializedTransaction
|
||||
|
||||
terResult = dirAdd(
|
||||
uSrcRef,
|
||||
Ledger::getRippleDirIndex(mTxnAccountID), // The source ended up owing.
|
||||
Ledger::getOwnerDirIndex(mTxnAccountID), // The source ended up owing.
|
||||
sleRippleState->getIndex()); // Adding current entry.
|
||||
|
||||
if (terSUCCESS != terResult)
|
||||
|
||||
@@ -221,14 +221,14 @@ protected:
|
||||
void entryDelete(SLE::pointer sleEntry, bool unfunded = false);
|
||||
void entryModify(SLE::pointer sleEntry);
|
||||
|
||||
uint32 rippleTransfer(const uint160& uIssuerID);
|
||||
uint32 rippleTransferRate(const uint160& uIssuerID);
|
||||
STAmount rippleBalance(const uint160& uToAccountID, const uint160& uFromAccountID, const uint160& uCurrencyID);
|
||||
STAmount rippleLimit(const uint160& uToAccountID, const uint160& uFromAccountID, const uint160& uCurrencyID);
|
||||
uint32 rippleQualityIn(const uint160& uToAccountID, const uint160& uFromAccountID, const uint160& uCurrencyID);
|
||||
uint32 rippleQualityOut(const uint160& uToAccountID, const uint160& uFromAccountID, const uint160& uCurrencyID);
|
||||
|
||||
STAmount rippleHolds(const uint160& uAccountID, const uint160& uCurrencyID, const uint160& uIssuerID);
|
||||
STAmount rippleTransfer(const uint160& uSenderID, const uint160& uReceiverID, const uint160& uIssuerID, const STAmount& saAmount);
|
||||
STAmount rippleTransferFee(const uint160& uSenderID, const uint160& uReceiverID, const uint160& uIssuerID, const STAmount& saAmount);
|
||||
void rippleCredit(const uint160& uSenderID, const uint160& uReceiverID, const STAmount& saAmount, bool bCheckIssuer=true);
|
||||
STAmount rippleSend(const uint160& uSenderID, const uint160& uReceiverID, const STAmount& saAmount);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user