Various tidying:

* Fix unused variable warnings.
* Clean unused items from TER.
* Improvement to LES use of shared_ptr.
This commit is contained in:
Tom Ritchford
2014-07-09 14:36:23 -04:00
committed by Vinnie Falco
parent 4d49d272eb
commit d7e08f96a5
7 changed files with 153 additions and 85 deletions

View File

@@ -2585,6 +2585,8 @@
<ClCompile Include="..\..\src\ripple\module\data\protocol\STAmount.cpp">
<ExcludedFromBuild>True</ExcludedFromBuild>
</ClCompile>
<ClInclude Include="..\..\src\ripple\module\data\protocol\STAmount.h">
</ClInclude>
<ClCompile Include="..\..\src\ripple\module\data\protocol\STAmountRound.cpp">
<ExcludedFromBuild>True</ExcludedFromBuild>
</ClCompile>
@@ -2605,6 +2607,8 @@
</ClCompile>
<ClInclude Include="..\..\src\ripple\module\data\protocol\SerializedObjectTemplate.h">
</ClInclude>
<ClInclude Include="..\..\src\ripple\module\data\protocol\SerializedType.h">
</ClInclude>
<ClCompile Include="..\..\src\ripple\module\data\protocol\SerializedTypes.cpp">
<ExcludedFromBuild>True</ExcludedFromBuild>
</ClCompile>
@@ -3327,6 +3331,8 @@
</ClInclude>
<ClInclude Include="..\..\src\ripple\types\api\Blob.h">
</ClInclude>
<ClInclude Include="..\..\src\ripple\types\api\Book.h">
</ClInclude>
<ClInclude Include="..\..\src\ripple\types\api\ByteOrder.h">
</ClInclude>
<ClInclude Include="..\..\src\ripple\types\api\CryptoIdentifier.h">
@@ -3337,6 +3343,8 @@
</ClInclude>
<ClInclude Include="..\..\src\ripple\types\api\IdentifierType.h">
</ClInclude>
<ClInclude Include="..\..\src\ripple\types\api\Issue.h">
</ClInclude>
<ClInclude Include="..\..\src\ripple\types\api\RandomNumbers.h">
</ClInclude>
<ClInclude Include="..\..\src\ripple\types\api\RippleAccountID.h">
@@ -3345,8 +3353,6 @@
</ClInclude>
<ClInclude Include="..\..\src\ripple\types\api\RippleAccountPublicKey.h">
</ClInclude>
<ClInclude Include="..\..\src\ripple\types\api\RippleAssets.h">
</ClInclude>
<ClInclude Include="..\..\src\ripple\types\api\RippleLedgerHash.h">
</ClInclude>
<ClInclude Include="..\..\src\ripple\types\api\RipplePrivateKey.h">
@@ -3371,10 +3377,10 @@
<ClCompile Include="..\..\src\ripple\types\impl\ByteOrder.cpp">
<ExcludedFromBuild>True</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\..\src\ripple\types\impl\RandomNumbers.cpp">
<ClCompile Include="..\..\src\ripple\types\impl\Issue.cpp">
<ExcludedFromBuild>True</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\..\src\ripple\types\impl\RippleAssets.cpp">
<ClCompile Include="..\..\src\ripple\types\impl\RandomNumbers.cpp">
<ExcludedFromBuild>True</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\..\src\ripple\types\impl\RippleIdentifierTests.cpp">
@@ -3723,6 +3729,8 @@
</ClInclude>
<ClInclude Include="..\..\src\rocksdb\include\rocksdb\flush_block_policy.h">
</ClInclude>
<ClInclude Include="..\..\src\rocksdb\include\rocksdb\iostats_context.h">
</ClInclude>
<ClInclude Include="..\..\src\rocksdb\include\rocksdb\iterator.h">
</ClInclude>
<ClInclude Include="..\..\src\rocksdb\include\rocksdb\memtablerep.h">
@@ -3796,6 +3804,11 @@
</ClCompile>
<ClInclude Include="..\..\src\rocksdb\table\block_hash_index.h">
</ClInclude>
<ClCompile Include="..\..\src\rocksdb\table\block_prefix_index.cc">
<ExcludedFromBuild>True</ExcludedFromBuild>
</ClCompile>
<ClInclude Include="..\..\src\rocksdb\table\block_prefix_index.h">
</ClInclude>
<ClCompile Include="..\..\src\rocksdb\table\filter_block.cc">
<ExcludedFromBuild>True</ExcludedFromBuild>
</ClCompile>
@@ -3836,6 +3849,11 @@
</ClCompile>
<ClInclude Include="..\..\src\rocksdb\table\plain_table_factory.h">
</ClInclude>
<ClCompile Include="..\..\src\rocksdb\table\plain_table_key_coding.cc">
<ExcludedFromBuild>True</ExcludedFromBuild>
</ClCompile>
<ClInclude Include="..\..\src\rocksdb\table\plain_table_key_coding.h">
</ClInclude>
<ClCompile Include="..\..\src\rocksdb\table\plain_table_reader.cc">
<ExcludedFromBuild>True</ExcludedFromBuild>
</ClCompile>
@@ -3930,6 +3948,11 @@
</ClCompile>
<ClInclude Include="..\..\src\rocksdb\util\histogram.h">
</ClInclude>
<ClCompile Include="..\..\src\rocksdb\util\iostats_context.cc">
<ExcludedFromBuild>True</ExcludedFromBuild>
</ClCompile>
<ClInclude Include="..\..\src\rocksdb\util\iostats_context_imp.h">
</ClInclude>
<ClCompile Include="..\..\src\rocksdb\util\log_buffer.cc">
<ExcludedFromBuild>True</ExcludedFromBuild>
</ClCompile>

View File

@@ -3690,6 +3690,9 @@
<ClCompile Include="..\..\src\ripple\module\data\protocol\STAmount.cpp">
<Filter>ripple\module\data\protocol</Filter>
</ClCompile>
<ClInclude Include="..\..\src\ripple\module\data\protocol\STAmount.h">
<Filter>ripple\module\data\protocol</Filter>
</ClInclude>
<ClCompile Include="..\..\src\ripple\module\data\protocol\STAmountRound.cpp">
<Filter>ripple\module\data\protocol</Filter>
</ClCompile>
@@ -3714,6 +3717,9 @@
<ClInclude Include="..\..\src\ripple\module\data\protocol\SerializedObjectTemplate.h">
<Filter>ripple\module\data\protocol</Filter>
</ClInclude>
<ClInclude Include="..\..\src\ripple\module\data\protocol\SerializedType.h">
<Filter>ripple\module\data\protocol</Filter>
</ClInclude>
<ClCompile Include="..\..\src\ripple\module\data\protocol\SerializedTypes.cpp">
<Filter>ripple\module\data\protocol</Filter>
</ClCompile>
@@ -4572,6 +4578,9 @@
<ClInclude Include="..\..\src\ripple\types\api\Blob.h">
<Filter>ripple\types\api</Filter>
</ClInclude>
<ClInclude Include="..\..\src\ripple\types\api\Book.h">
<Filter>ripple\types\api</Filter>
</ClInclude>
<ClInclude Include="..\..\src\ripple\types\api\ByteOrder.h">
<Filter>ripple\types\api</Filter>
</ClInclude>
@@ -4587,6 +4596,9 @@
<ClInclude Include="..\..\src\ripple\types\api\IdentifierType.h">
<Filter>ripple\types\api</Filter>
</ClInclude>
<ClInclude Include="..\..\src\ripple\types\api\Issue.h">
<Filter>ripple\types\api</Filter>
</ClInclude>
<ClInclude Include="..\..\src\ripple\types\api\RandomNumbers.h">
<Filter>ripple\types\api</Filter>
</ClInclude>
@@ -4599,9 +4611,6 @@
<ClInclude Include="..\..\src\ripple\types\api\RippleAccountPublicKey.h">
<Filter>ripple\types\api</Filter>
</ClInclude>
<ClInclude Include="..\..\src\ripple\types\api\RippleAssets.h">
<Filter>ripple\types\api</Filter>
</ClInclude>
<ClInclude Include="..\..\src\ripple\types\api\RippleLedgerHash.h">
<Filter>ripple\types\api</Filter>
</ClInclude>
@@ -4635,10 +4644,10 @@
<ClCompile Include="..\..\src\ripple\types\impl\ByteOrder.cpp">
<Filter>ripple\types\impl</Filter>
</ClCompile>
<ClCompile Include="..\..\src\ripple\types\impl\RandomNumbers.cpp">
<ClCompile Include="..\..\src\ripple\types\impl\Issue.cpp">
<Filter>ripple\types\impl</Filter>
</ClCompile>
<ClCompile Include="..\..\src\ripple\types\impl\RippleAssets.cpp">
<ClCompile Include="..\..\src\ripple\types\impl\RandomNumbers.cpp">
<Filter>ripple\types\impl</Filter>
</ClCompile>
<ClCompile Include="..\..\src\ripple\types\impl\RippleIdentifierTests.cpp">
@@ -5085,6 +5094,9 @@
<ClInclude Include="..\..\src\rocksdb\include\rocksdb\flush_block_policy.h">
<Filter>rocksdb\include\rocksdb</Filter>
</ClInclude>
<ClInclude Include="..\..\src\rocksdb\include\rocksdb\iostats_context.h">
<Filter>rocksdb\include\rocksdb</Filter>
</ClInclude>
<ClInclude Include="..\..\src\rocksdb\include\rocksdb\iterator.h">
<Filter>rocksdb\include\rocksdb</Filter>
</ClInclude>
@@ -5184,6 +5196,12 @@
<ClInclude Include="..\..\src\rocksdb\table\block_hash_index.h">
<Filter>rocksdb\table</Filter>
</ClInclude>
<ClCompile Include="..\..\src\rocksdb\table\block_prefix_index.cc">
<Filter>rocksdb\table</Filter>
</ClCompile>
<ClInclude Include="..\..\src\rocksdb\table\block_prefix_index.h">
<Filter>rocksdb\table</Filter>
</ClInclude>
<ClCompile Include="..\..\src\rocksdb\table\filter_block.cc">
<Filter>rocksdb\table</Filter>
</ClCompile>
@@ -5232,6 +5250,12 @@
<ClInclude Include="..\..\src\rocksdb\table\plain_table_factory.h">
<Filter>rocksdb\table</Filter>
</ClInclude>
<ClCompile Include="..\..\src\rocksdb\table\plain_table_key_coding.cc">
<Filter>rocksdb\table</Filter>
</ClCompile>
<ClInclude Include="..\..\src\rocksdb\table\plain_table_key_coding.h">
<Filter>rocksdb\table</Filter>
</ClInclude>
<ClCompile Include="..\..\src\rocksdb\table\plain_table_reader.cc">
<Filter>rocksdb\table</Filter>
</ClCompile>
@@ -5343,6 +5367,12 @@
<ClInclude Include="..\..\src\rocksdb\util\histogram.h">
<Filter>rocksdb\util</Filter>
</ClInclude>
<ClCompile Include="..\..\src\rocksdb\util\iostats_context.cc">
<Filter>rocksdb\util</Filter>
</ClCompile>
<ClInclude Include="..\..\src\rocksdb\util\iostats_context_imp.h">
<Filter>rocksdb\util</Filter>
</ClInclude>
<ClCompile Include="..\..\src\rocksdb\util\log_buffer.cc">
<Filter>rocksdb\util</Filter>
</ClCompile>

View File

@@ -72,8 +72,9 @@ message_parser::check_url()
{
checked_url_ = true;
auto const p (reinterpret_cast <joyent::http_parser const*> (&state_));
ec_ = on_request (joyent::convert_http_method (
joyent::http_method(p->method)), p->http_major, p->http_minor, url_);
ec_ = on_request (
joyent::convert_http_method (joyent::http_method(p->method)),
p->http_major, p->http_minor, url_);
if (ec_)
return 1;
}
@@ -96,7 +97,6 @@ message_parser::do_url (char const* in, std::size_t bytes)
int
message_parser::do_status (char const* in, std::size_t bytes)
{
auto const p (reinterpret_cast <joyent::http_parser const*> (&state_));
return ec_ ? 1 : 0;
}
@@ -132,8 +132,6 @@ message_parser::do_headers_done ()
{
if (check_url())
return 1;
auto const p (reinterpret_cast <joyent::http_parser const*> (&state_));
bool const keep_alive (joyent::http_should_keep_alive (p) != 0);
if (! value_.empty())
{
ec_ = on_field (field_, value_);
@@ -148,17 +146,12 @@ message_parser::do_headers_done ()
int
message_parser::do_body (char const* in, std::size_t bytes)
{
auto const p (reinterpret_cast <joyent::http_parser const*> (&state_));
bool const is_final (
joyent::http_body_is_final (p) != 0);
return ec_ ? 1 : 0;
}
int
message_parser::do_message_complete ()
{
auto const p (reinterpret_cast <joyent::http_parser const*> (&state_));
bool const keep_alive (joyent::http_should_keep_alive (p) != 0);
complete_ = true;
return 0;
}

View File

@@ -1055,6 +1055,8 @@ void LedgerEntrySet::ownerCountAdjust (
TER LedgerEntrySet::offerDelete (SLE::pointer sleOffer)
{
if (!sleOffer)
return tesSUCCESS;
auto offerIndex = sleOffer->getIndex ();
auto owner = sleOffer->getFieldAccount160 (sfAccount);
@@ -1079,16 +1081,6 @@ TER LedgerEntrySet::offerDelete (SLE::pointer sleOffer)
return (terResult == tesSUCCESS) ? terResult2 : terResult;
}
TER LedgerEntrySet::offerDelete (uint256 const& offerIndex)
{
SLE::pointer sleOffer = entryCache (ltOFFER, offerIndex);
if (!sleOffer)
return tesSUCCESS;
return offerDelete (sleOffer);
}
// Returns amount owed by uToAccountID to uFromAccountID.
// <-- $owed/currency/uToAccountID:
// positive: uFromAccountID holds IOUs.,

View File

@@ -180,15 +180,18 @@ public:
bool dirIsEmpty (uint256 const& uDirIndex);
TER dirCount (uint256 const& uDirIndex, std::uint32_t & uCount);
uint256 getNextLedgerIndex (uint256 const & uHash);
uint256 getNextLedgerIndex (uint256 const & uHash, uint256 const & uEnd);
uint256 getNextLedgerIndex (uint256 const& uHash);
uint256 getNextLedgerIndex (uint256 const& uHash, uint256 const & uEnd);
void ownerCountAdjust (Account const& uOwnerID, int iAmount,
SLE::ref sleAccountRoot = SLE::pointer ());
// Offer functions.
TER offerDelete (uint256 const & offerIndex);
TER offerDelete (SLE::pointer sleOffer);
TER offerDelete (SLE::pointer);
TER offerDelete (uint256 const& offerIndex)
{
return offerDelete( entryCache (ltOFFER, offerIndex));
}
// Balance functions.
std::uint32_t rippleTransferRate (Account const& issuer);

View File

@@ -36,7 +36,7 @@ bool transResultInfo (TER terCode, std::string& strToken, std::string& strHuman)
{ tecNO_DST, "tecNO_DST", "Destination does not exist. Send XRP to create it." },
{ tecNO_DST_INSUF_XRP, "tecNO_DST_INSUF_XRP", "Destination does not exist. Too little XRP sent to create it." },
{ tecNO_LINE_INSUF_RESERVE, "tecNO_LINE_INSUF_RESERVE", "No such line. Too little reserve to create it." },
{ tecNO_LINE_REDUNDANT, "tecNO_LINE_REDUNDANT", "Can't set non-existant line to default." },
{ tecNO_LINE_REDUNDANT, "tecNO_LINE_REDUNDANT", "Can't set non-existent line to default." },
{ tecPATH_DRY, "tecPATH_DRY", "Path could not send partial amount." },
{ tecPATH_PARTIAL, "tecPATH_PARTIAL", "Path could not send full amount." },
{ tecMASTER_DISABLED, "tecMASTER_DISABLED", "Master key is disabled." },
@@ -51,24 +51,20 @@ bool transResultInfo (TER terCode, std::string& strToken, std::string& strHuman)
{ tecNO_AUTH, "tecNO_AUTH", "Not authorized to hold asset." },
{ tecNO_LINE, "tecNO_LINE", "No such line." },
{ tefFAILURE, "tefFAILURE", "Failed to apply." },
{ tefALREADY, "tefALREADY", "The exact transaction was already in this ledger." },
{ tefBAD_ADD_AUTH, "tefBAD_ADD_AUTH", "Not authorized to add account." },
{ tefBAD_AUTH, "tefBAD_AUTH", "Transaction's public key is not authorized." },
{ tefBAD_CLAIM_ID, "tefBAD_CLAIM_ID", "Malformed: Bad claim id." },
{ 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." },
{ tefCREATED, "tefCREATED", "Can't add an already created account." },
{ tefDST_TAG_NEEDED, "tefDST_TAG_NEEDED", "Destination tag required." },
{ tefEXCEPTION, "tefEXCEPTION", "Unexpected program state." },
{ tefGEN_IN_USE, "tefGEN_IN_USE", "Generator already in use." },
{ tefFAILURE, "tefFAILURE", "Failed to apply." },
{ tefINTERNAL, "tefINTERNAL", "Internal error." },
{ tefMASTER_DISABLED, "tefMASTER_DISABLED", "Master key is disabled." },
{ tefMAX_LEDGER, "tefMAX_LEDGER", "Ledger sequence too high." },
{ tefNO_AUTH_REQUIRED, "tefNO_AUTH_REQUIRED", "Auth is not required." },
{ tefPAST_SEQ, "tefPAST_SEQ", "This sequence number has already past." },
{ tefWRONG_PRIOR, "tefWRONG_PRIOR", "This previous transaction does not match." },
{ tefMASTER_DISABLED, "tefMASTER_DISABLED", "Master key is disabled." },
{ tefMAX_LEDGER, "tefMAX_LEDGER", "Ledger sequence too high." },
{ telLOCAL_ERROR, "telLOCAL_ERROR", "Local failure." },
{ telBAD_DOMAIN, "telBAD_DOMAIN", "Domain too long." },
@@ -82,23 +78,22 @@ bool transResultInfo (TER terCode, std::string& strToken, std::string& strHuman)
{ temBAD_AMOUNT, "temBAD_AMOUNT", "Can only send positive amounts." },
{ temBAD_AUTH_MASTER, "temBAD_AUTH_MASTER", "Auth for unclaimed account needs correct master key." },
{ temBAD_CURRENCY, "temBAD_CURRENCY", "Malformed: Bad currency." },
{ temBAD_FEE, "temBAD_FEE", "Invalid fee, negative or not XRP." },
{ temBAD_EXPIRATION, "temBAD_EXPIRATION", "Malformed: Bad expiration." },
{ temBAD_FEE, "temBAD_FEE", "Invalid fee, negative or not XRP." },
{ temBAD_ISSUER, "temBAD_ISSUER", "Malformed: Bad issuer." },
{ temBAD_LIMIT, "temBAD_LIMIT", "Limits must be non-negative." },
{ temBAD_OFFER, "temBAD_OFFER", "Malformed: Bad offer." },
{ temBAD_PATH, "temBAD_PATH", "Malformed: Bad path." },
{ temBAD_PATH_LOOP, "temBAD_PATH_LOOP", "Malformed: Loop in path." },
{ temBAD_PUBLISH, "temBAD_PUBLISH", "Malformed: Bad publish." },
{ temBAD_SIGNATURE, "temBAD_SIGNATURE", "Malformed: Bad signature." },
{ temBAD_SRC_ACCOUNT, "temBAD_SRC_ACCOUNT", "Malformed: Bad source account." },
{ temBAD_TRANSFER_RATE, "temBAD_TRANSFER_RATE", "Malformed: Transfer rate must be >= 1.0" },
{ temBAD_SEQUENCE, "temBAD_SEQUENCE", "Malformed: Sequence is not in the past." },
{ temBAD_SEND_XRP_LIMIT, "temBAD_SEND_XRP_LIMIT", "Malformed: Limit quality is not allowed for XRP to XRP." },
{ temBAD_SEND_XRP_MAX, "temBAD_SEND_XRP_MAX", "Malformed: Send max is not allowed for XRP to XRP." },
{ temBAD_SEND_XRP_NO_DIRECT, "temBAD_SEND_XRP_NO_DIRECT", "Malformed: No Ripple direct is not allowed for XRP to XRP." },
{ temBAD_SEND_XRP_PARTIAL, "temBAD_SEND_XRP_PARTIAL", "Malformed: Partial payment is not allowed for XRP to XRP." },
{ temBAD_SEND_XRP_PATHS, "temBAD_SEND_XRP_PATHS", "Malformed: Paths are not allowed for XRP to XRP." },
{ temBAD_SEQUENCE, "temBAD_SEQUENCE", "Malformed: Sequence is not in the past." },
{ temBAD_SIGNATURE, "temBAD_SIGNATURE", "Malformed: Bad signature." },
{ temBAD_SRC_ACCOUNT, "temBAD_SRC_ACCOUNT", "Malformed: Bad source account." },
{ temBAD_TRANSFER_RATE, "temBAD_TRANSFER_RATE", "Malformed: Transfer rate must be >= 1.0" },
{ temDST_IS_SRC, "temDST_IS_SRC", "Destination may not be source." },
{ temDST_NEEDED, "temDST_NEEDED", "Destination not specified." },
{ temINVALID, "temINVALID", "The transaction is ill-formed." },

View File

@@ -24,10 +24,6 @@ namespace ripple {
// See https://ripple.com/wiki/Transaction_errors
// VFALCO TODO do not use auto-incrementing. Explicitly assign each
// constant so there is no possibility of someone coming in
// and screwing it up.
//
// VFALCO TODO consider renaming TER to TxErr or TxResult for clarity.
//
enum TER // aka TransactionEngineResult
@@ -40,7 +36,7 @@ enum TER // aka TransactionEngineResult
// - Not forwarded
// - No fee check
telLOCAL_ERROR = -399,
telBAD_DOMAIN, // VFALCO TODO should read "telBAD_DOMAIN = -398," etc...
telBAD_DOMAIN,
telBAD_PATH_COUNT,
telBAD_PUBLIC_KEY,
telFAILED_PROCESSING,
@@ -56,26 +52,26 @@ enum TER // aka TransactionEngineResult
// - Reject
// - Can not succeed in any imagined ledger.
temMALFORMED = -299,
temBAD_AMOUNT,
temBAD_AUTH_MASTER,
temBAD_CURRENCY,
temBAD_FEE,
temBAD_EXPIRATION,
temBAD_FEE,
temBAD_ISSUER,
temBAD_LIMIT,
temBAD_OFFER,
temBAD_PATH,
temBAD_PATH_LOOP,
temBAD_PUBLISH,
temBAD_TRANSFER_RATE,
temBAD_SEND_XRP_LIMIT,
temBAD_SEND_XRP_MAX,
temBAD_SEND_XRP_NO_DIRECT,
temBAD_SEND_XRP_PARTIAL,
temBAD_SEND_XRP_PATHS,
temBAD_SEQUENCE,
temBAD_SIGNATURE,
temBAD_SRC_ACCOUNT,
temBAD_SEQUENCE,
temBAD_TRANSFER_RATE,
temDST_IS_SRC,
temDST_NEEDED,
temINVALID,
@@ -83,14 +79,19 @@ enum TER // aka TransactionEngineResult
temREDUNDANT,
temREDUNDANT_SEND_MAX,
temRIPPLE_EMPTY,
temUNCERTAIN, // An intermediate result used internally, should never be returned.
// An intermediate result used internally, should never be returned.
temUNCERTAIN,
temUNKNOWN,
// -199 .. -100: F Failure (sequence number previously used)
// -199 .. -100: F
// Failure (sequence number previously used)
//
// Causes:
// - Transaction cannot succeed because of ledger state.
// - Unexpected ledger state.
// - C++ exception.
//
// Implications:
// - Not applied
// - Not forwarded
@@ -99,14 +100,10 @@ enum TER // aka TransactionEngineResult
tefALREADY,
tefBAD_ADD_AUTH,
tefBAD_AUTH,
tefBAD_CLAIM_ID,
tefBAD_GEN_AUTH,
tefBAD_LEDGER,
tefCLAIMED,
tefCREATED,
tefDST_TAG_NEEDED,
tefEXCEPTION,
tefGEN_IN_USE,
tefINTERNAL,
tefNO_AUTH_REQUIRED, // Can't set auth if auth is not required.
tefPAST_SEQ,
@@ -114,9 +111,14 @@ enum TER // aka TransactionEngineResult
tefMASTER_DISABLED,
tefMAX_LEDGER,
// -99 .. -1: R Retry (sequence too high, no funds for txn fee, originating account non-existent)
// Causes:
// - Prior application of another, possibly non-existant, another transaction could allow this transaction to succeed.
// -99 .. -1: R Retry
// sequence too high, no funds for txn fee, originating -account
// non-existent
//
// Cause:
// Prior application of another, possibly non-existent, transaction could
// allow this transaction to succeed.
//
// Implications:
// - Not applied
// - Not forwarded
@@ -124,15 +126,16 @@ enum TER // aka TransactionEngineResult
// - Hold
// - Makes hole in sequence which jams transactions.
terRETRY = -99,
terFUNDS_SPENT, // This is a free transaction, therefore don't burden network.
terINSUF_FEE_B, // Can't pay fee, therefore don't burden network.
terNO_ACCOUNT, // Can't pay fee, therefore don't burden network.
terNO_AUTH, // Not authorized to hold IOUs.
terNO_LINE, // Internal flag.
terOWNERS, // Can't succeed with non-zero owner count.
terPRE_SEQ, // Can't pay fee, no point in forwarding, therefore don't burden network.
terLAST, // Process after all other transactions
terNO_RIPPLE, // Rippling not allowed
terFUNDS_SPENT, // This is a free transaction, so don't burden network.
terINSUF_FEE_B, // Can't pay fee, therefore don't burden network.
terNO_ACCOUNT, // Can't pay fee, therefore don't burden network.
terNO_AUTH, // Not authorized to hold IOUs.
terNO_LINE, // Internal flag.
terOWNERS, // Can't succeed with non-zero owner count.
terPRE_SEQ, // Can't pay fee, no point in forwarding, so don't
// burden network.
terLAST, // Process after all other transactions
terNO_RIPPLE, // Rippling not allowed
// 0: S Success (success)
// Causes:
@@ -142,14 +145,21 @@ enum TER // aka TransactionEngineResult
// - Forwarded
tesSUCCESS = 0,
// 100 .. 159 C Claim fee only (ripple transaction with no good paths, pay to non-existent account, no path)
// 100 .. 159 C
// Claim fee only (ripple transaction with no good paths, pay to
// non-existent account, no path)
//
// Causes:
// - Success, but does not achieve optimal result.
// - Invalid transaction or no effect, but claim fee to use the sequence number.
// - Invalid transaction or no effect, but claim fee to use the sequence
// number.
//
// Implications:
// - Applied
// - Forwarded
// Only allowed as a return code of appliedTransaction when !tapRetry. Otherwise, treated as terRETRY.
//
// Only allowed as a return code of appliedTransaction when !tapRetry.
// Otherwise, treated as terRETRY.
//
// DO NOT CHANGE THESE NUMBERS: They appear in ledger meta data.
tecCLAIM = 100,
@@ -175,13 +185,35 @@ enum TER // aka TransactionEngineResult
tecNO_LINE = 135,
};
// VFALCO TODO change these to normal functions.
#define isTelLocal(x) ((x) >= telLOCAL_ERROR && (x) < temMALFORMED)
#define isTemMalformed(x) ((x) >= temMALFORMED && (x) < tefFAILURE)
#define isTefFailure(x) ((x) >= tefFAILURE && (x) < terRETRY)
#define isTerRetry(x) ((x) >= terRETRY && (x) < tesSUCCESS)
#define isTesSuccess(x) ((x) == tesSUCCESS)
#define isTecClaim(x) ((x) >= tecCLAIM)
inline bool isTelLocal(TER x)
{
return ((x) >= telLOCAL_ERROR && (x) < temMALFORMED);
}
inline bool isTemMalformed(TER x)
{
return ((x) >= temMALFORMED && (x) < tefFAILURE);
}
inline bool isTefFailure(TER x)
{
return ((x) >= tefFAILURE && (x) < terRETRY);
}
inline bool isTerRetry(TER x)
{
return ((x) >= terRETRY && (x) < tesSUCCESS);
}
inline bool isTesSuccess(TER x)
{
return ((x) == tesSUCCESS);
}
inline bool isTecClaim(TER x)
{
return ((x) >= tecCLAIM);
}
// VFALCO TODO group these into a shell class along with the defines above.
extern bool transResultInfo (TER terCode, std::string& strToken, std::string& strHuman);