mirror of
https://github.com/XRPLF/rippled.git
synced 2025-12-06 17:27:55 +00:00
Change/Fee transactor.
This commit is contained in:
@@ -16,16 +16,18 @@ enum TransactionEngineParams
|
||||
{
|
||||
tapNONE = 0x00,
|
||||
|
||||
tapNO_CHECK_SIGN = 0x01, // Signature already checked
|
||||
tapNO_CHECK_SIGN = 0x01, // Signature already checked
|
||||
|
||||
tapOPEN_LEDGER = 0x10, // Transaction is running against an open ledger
|
||||
tapOPEN_LEDGER = 0x10, // Transaction is running against an open ledger
|
||||
// true = failures are not forwarded, check transaction fee
|
||||
// false = debit ledger for consumed funds
|
||||
|
||||
tapRETRY = 0x20, // This is not the transaction's last pass
|
||||
tapRETRY = 0x20, // This is not the transaction's last pass
|
||||
// Transaction can be retried, soft failures allowed
|
||||
|
||||
tapADMIN = 0x40, // Transaction came from a privileged source
|
||||
tapAFTER_END = 0x40, // We are processing the transaction last
|
||||
|
||||
tapADMIN = 0x400, // Transaction came from a privileged source
|
||||
};
|
||||
|
||||
enum LedgerEntryAction
|
||||
|
||||
@@ -315,6 +315,17 @@ bool STVector256::isEquivalent(const SerializedType& t) const
|
||||
return v && (mValue == v->mValue);
|
||||
}
|
||||
|
||||
bool STVector256::hasValue(const uint256& v) const
|
||||
{
|
||||
BOOST_FOREACH(const uint256& hash, mValue)
|
||||
{
|
||||
if (hash == v)
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
//
|
||||
// STAccount
|
||||
//
|
||||
|
||||
@@ -869,7 +869,7 @@ public:
|
||||
void setValue(const STVector256& v) { mValue = v.mValue; }
|
||||
void setValue(const std::vector<uint256>& v) { mValue = v; }
|
||||
void addValue(const uint256& v) { mValue.push_back(v); }
|
||||
|
||||
bool hasValue(const uint256& v) const;
|
||||
|
||||
Json::Value getJson(int) const;
|
||||
};
|
||||
|
||||
@@ -83,6 +83,7 @@ bool transResultInfo(TER terCode, std::string& strToken, std::string& strHuman)
|
||||
{ terRETRY, "terRETRY", "Retry transaction." },
|
||||
{ terFUNDS_SPENT, "terFUNDS_SPENT", "Can't set password, password set funds already spent." },
|
||||
{ terINSUF_FEE_B, "terINSUF_FEE_B", "Account balance can't pay fee." },
|
||||
{ terLAST, "terLAST", "Process last." },
|
||||
{ terNO_ACCOUNT, "terNO_ACCOUNT", "The source account does not exist." },
|
||||
{ terNO_AUTH, "terNO_AUTH", "Not authorized to hold IOUs." },
|
||||
{ terNO_LINE, "terNO_LINE", "No such line." },
|
||||
|
||||
@@ -101,6 +101,7 @@ enum TER // aka TransactionEngineResult
|
||||
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
|
||||
|
||||
// 0: S Success (success)
|
||||
// Causes:
|
||||
|
||||
@@ -78,12 +78,11 @@ void TFInit()
|
||||
;
|
||||
|
||||
DECLARE_TF(SetFee, ttFEE)
|
||||
<< SOElement(sfFeatures, SOE_REQUIRED)
|
||||
<< SOElement(sfBaseFee, SOE_REQUIRED)
|
||||
<< SOElement(sfReferenceFeeUnits, SOE_REQUIRED)
|
||||
<< SOElement(sfReserveBase, SOE_REQUIRED)
|
||||
<< SOElement(sfReserveIncrement, SOE_REQUIRED)
|
||||
;
|
||||
;
|
||||
}
|
||||
|
||||
TransactionFormat* TransactionFormat::getTxnFormat(TransactionType t)
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
#include "OfferCancelTransactor.h"
|
||||
#include "OfferCreateTransactor.h"
|
||||
#include "TrustSetTransactor.h"
|
||||
#include "ChangeTransactor.h"
|
||||
|
||||
SETUP_LOG();
|
||||
|
||||
@@ -29,6 +30,11 @@ UPTR_T<Transactor> Transactor::makeTransactor(const SerializedTransaction& txn,T
|
||||
return UPTR_T<Transactor>(new OfferCancelTransactor(txn, params, engine));
|
||||
case ttWALLET_ADD:
|
||||
return UPTR_T<Transactor>(new WalletAddTransactor(txn, params, engine));
|
||||
|
||||
case ttFEATURE:
|
||||
case ttFEE:
|
||||
return UPTR_T<Transactor>(new ChangeTransactor(txn, params, engine));
|
||||
|
||||
default:
|
||||
return UPTR_T<Transactor>();
|
||||
}
|
||||
|
||||
@@ -22,9 +22,9 @@ protected:
|
||||
bool mHasAuthKey;
|
||||
RippleAddress mSigningPubKey;
|
||||
|
||||
TER preCheck();
|
||||
TER checkSeq();
|
||||
TER payFee();
|
||||
virtual TER preCheck();
|
||||
virtual TER checkSeq();
|
||||
virtual TER payFee();
|
||||
|
||||
void calculateFee();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user