Final cleanups.

This commit is contained in:
JoelKatz
2013-04-24 08:29:08 -07:00
parent b0519df150
commit a7b679e2d0
7 changed files with 14 additions and 10 deletions

View File

@@ -493,7 +493,7 @@ TER OfferCreateTransactor::doApply()
% saTakerPays.getFullText());
// Take using the parameters of the offer.
cLog(lsWARNING) << "OfferCreate: takeOffers: BEFORE saTakerGets=" << saTakerGets.getFullText();
cLog(lsDEBUG) << "OfferCreate: takeOffers: BEFORE saTakerGets=" << saTakerGets.getFullText();
terResult = takeOffers(
bOpenLedger,
@@ -614,8 +614,8 @@ TER OfferCreateTransactor::doApply()
cLog(lsDEBUG) << "OfferCreate: sfAccount=" << RippleAddress::createHumanAccountID(mTxnAccountID);
cLog(lsDEBUG) << "OfferCreate: uPaysIssuerID=" << RippleAddress::createHumanAccountID(uPaysIssuerID);
cLog(lsDEBUG) << "OfferCreate: uGetsIssuerID=" << RippleAddress::createHumanAccountID(uGetsIssuerID);
cLog(lsDEBUG) << "OfferCreate: saTakerPays.isNative()=" << saTakerPays.isNative();
cLog(lsDEBUG) << "OfferCreate: saTakerGets.isNative()=" << saTakerGets.isNative();
cLog(lsTRACE) << "OfferCreate: saTakerPays.isNative()=" << saTakerPays.isNative();
cLog(lsTRACE) << "OfferCreate: saTakerGets.isNative()=" << saTakerGets.isNative();
cLog(lsDEBUG) << "OfferCreate: uPaysCurrency=" << saTakerPays.getHumanCurrency();
cLog(lsDEBUG) << "OfferCreate: uGetsCurrency=" << saTakerGets.getHumanCurrency();

View File

@@ -19,6 +19,7 @@ DEFINE_INSTANCE(Suppression);
#define SF_SIGGOOD 0x04 // Signature is good
#define SF_SAVED 0x08
#define SF_RETRY 0x10 // Transaction can be retried
#define SF_TRUSTED 0x20 // comes from trusted source
class Suppression : private IS_INSTANCE(Suppression)
{

View File

@@ -299,7 +299,8 @@ Json::Value Transaction::getJson(int options, bool binary) const
if (mInLedger)
{
ret["inLedger"] = mInLedger;
ret["inLedger"] = mInLedger; // Deprecated.
ret["ledger_index"] = mInLedger;
if(options == 1)
{

View File

@@ -33,12 +33,12 @@ bool transResultInfo(TER terCode, std::string& strToken, std::string& strHuman)
{ tefBAD_GEN_AUTH, "tefBAD_GEN_AUTH", "Not authorized to claim generator." },
{ tefBAD_LEDGER, "tefBAD_LEDGER", "Ledger in unexpected state." },
{ tefCLAIMED, "tefCLAIMED", "Can not claim a previously claimed account." },
{ tefEXCEPTION, "tefEXCEPTION", "Unexpected program state." },
{ tefCREATED, "tefCREATED", "Can't add an already created account." },
{ tefEXCEPTION, "tefEXCEPTION", "Unexpected program state." },
{ tefGEN_IN_USE, "tefGEN_IN_USE", "Generator already in use." },
{ tefINTERNAL, "tefINTERNAL", "Internal error." },
{ tefNO_AUTH_REQUIRED, "tefNO_AUTH_REQUIRED", "Auth is not required." },
{ tefPAST_SEQ, "tefPAST_SEQ", "This sequence number has already past." },
{ tefINTERNAL, "tefINTERNAL", "Internal error." },
{ telLOCAL_ERROR, "telLOCAL_ERROR", "Local failure." },
{ telBAD_DOMAIN, "telBAD_DOMAIN", "Domain too long." },

View File

@@ -80,9 +80,9 @@ enum TER // aka TransactionEngineResult
tefCREATED,
tefEXCEPTION,
tefGEN_IN_USE,
tefINTERNAL,
tefNO_AUTH_REQUIRED, // Can't set auth if auth is not required.
tefPAST_SEQ,
tefINTERNAL,
// -99 .. -1: R Retry (sequence too high, no funds for txn fee, originating account non-existent)
// Causes:

View File

@@ -81,9 +81,9 @@ TER TrustSetTransactor::doApply()
return tecNO_DST;
}
const uint32 uOwnerCount = mTxnAccount->getFieldU32(sfOwnerCount);
const uint32 uOwnerCount = mTxnAccount->getFieldU32(sfOwnerCount);
// The reserve required to create the line.
const uint64 uReserveCreate = mEngine->getLedger()->getReserve(uOwnerCount + 1);
const uint64 uReserveCreate = mEngine->getLedger()->getReserve(uOwnerCount + 1);
STAmount saLimitAllow = saLimitAmount;
saLimitAllow.setIssuer(mTxnAccountID);

View File

@@ -86,6 +86,8 @@ bool ValidationCollection::addValidation(SerializedValidation::ref val, const st
<< " added " << (val->isTrusted() ? "trusted/" : "UNtrusted/") << (isCurrent ? "current" : "stale");
if (val->isTrusted())
theApp->getLedgerMaster().checkAccept(hash);
// FIXME: This never forwards untrusted validations
return isCurrent;
}
@@ -95,7 +97,7 @@ ValidationSet ValidationCollection::getValidations(const uint256& ledger)
boost::mutex::scoped_lock sl(mValidationLock);
VSpointer set = findSet(ledger);
if (set)
return ValidationSet(*set);
return *set;
}
return ValidationSet();
}