mirror of
https://github.com/XRPLF/rippled.git
synced 2025-11-21 19:45:53 +00:00
Refactor TxFormats and fix leak on exit
This commit is contained in:
@@ -45,7 +45,7 @@ Transaction::pointer Transaction::sharedTransaction (Blob const& vucTransaction,
|
||||
//
|
||||
|
||||
Transaction::Transaction (
|
||||
TransactionType ttKind,
|
||||
TxType ttKind,
|
||||
const RippleAddress& naPublicKey,
|
||||
const RippleAddress& naSourceAccount,
|
||||
uint32 uSeq,
|
||||
|
||||
@@ -44,7 +44,7 @@ public:
|
||||
static Transaction::pointer transactionFromSQL (Database * db, bool bValidate);
|
||||
|
||||
Transaction (
|
||||
TransactionType ttKind,
|
||||
TxType ttKind,
|
||||
const RippleAddress & naPublicKey, // To prove transaction is consistent and authorized.
|
||||
const RippleAddress & naSourceAccount, // To identify the paying account.
|
||||
uint32 uSeq, // To order transactions.
|
||||
|
||||
@@ -7,7 +7,6 @@
|
||||
namespace po = boost::program_options;
|
||||
|
||||
// VFALCO TODO make these singletons that initialize statically
|
||||
extern void TFInit ();
|
||||
extern void LEFInit ();
|
||||
|
||||
void setupServer ()
|
||||
@@ -210,7 +209,6 @@ int rippleMain (int argc, char** argv)
|
||||
Log::setMinSeverity (lsINFO, true);
|
||||
|
||||
// VFALCO TODO make these singletons that initialize statically
|
||||
TFInit ();
|
||||
LEFInit ();
|
||||
|
||||
if (vm.count ("unittest"))
|
||||
|
||||
@@ -56,7 +56,7 @@ public:
|
||||
{
|
||||
return mTxn->getTransactionID ();
|
||||
}
|
||||
TransactionType getTxnType () const
|
||||
TxType getTxnType () const
|
||||
{
|
||||
return mTxn->getTxnType ();
|
||||
}
|
||||
|
||||
@@ -6,15 +6,15 @@
|
||||
|
||||
SETUP_LOG (SerializedTransaction)
|
||||
|
||||
SerializedTransaction::SerializedTransaction (TransactionType type)
|
||||
SerializedTransaction::SerializedTransaction (TxType type)
|
||||
: STObject (sfTransaction)
|
||||
, mType (type)
|
||||
, mSigGood (false)
|
||||
, mSigBad (false)
|
||||
{
|
||||
mFormat = TxFormats::getInstance ().findByType (type);
|
||||
mFormat = TxFormats::getInstance().findByType (type);
|
||||
|
||||
if (mFormat == NULL)
|
||||
if (mFormat == nullptr)
|
||||
{
|
||||
WriteLog (lsWARNING, SerializedTransaction) << "Transaction type: " << type;
|
||||
throw std::runtime_error ("invalid transaction type");
|
||||
@@ -29,9 +29,9 @@ SerializedTransaction::SerializedTransaction (STObject const& object)
|
||||
, mSigGood (false)
|
||||
, mSigBad (false)
|
||||
{
|
||||
mType = static_cast <TransactionType> (getFieldU16 (sfTransactionType));
|
||||
mType = static_cast <TxType> (getFieldU16 (sfTransactionType));
|
||||
|
||||
mFormat = TxFormats::getInstance ().findByType (mType);
|
||||
mFormat = TxFormats::getInstance().findByType (mType);
|
||||
|
||||
if (!mFormat)
|
||||
{
|
||||
@@ -57,9 +57,9 @@ SerializedTransaction::SerializedTransaction (SerializerIterator& sit) : STObjec
|
||||
}
|
||||
|
||||
set (sit);
|
||||
mType = static_cast<TransactionType> (getFieldU16 (sfTransactionType));
|
||||
mType = static_cast<TxType> (getFieldU16 (sfTransactionType));
|
||||
|
||||
mFormat = TxFormats::getInstance ().findByType (mType);
|
||||
mFormat = TxFormats::getInstance().findByType (mType);
|
||||
|
||||
if (!mFormat)
|
||||
{
|
||||
|
||||
@@ -28,7 +28,7 @@ public:
|
||||
|
||||
public:
|
||||
SerializedTransaction (SerializerIterator & sit);
|
||||
SerializedTransaction (TransactionType type);
|
||||
SerializedTransaction (TxType type);
|
||||
SerializedTransaction (const STObject & object);
|
||||
|
||||
// STObject functions
|
||||
@@ -47,7 +47,7 @@ public:
|
||||
}
|
||||
uint256 getSigningHash () const;
|
||||
|
||||
TransactionType getTxnType () const
|
||||
TxType getTxnType () const
|
||||
{
|
||||
return mType;
|
||||
}
|
||||
@@ -127,8 +127,8 @@ public:
|
||||
std::string getMetaSQL (Serializer rawTxn, uint32 inLedger, char status, const std::string & escapedMetaData) const;
|
||||
|
||||
private:
|
||||
TransactionType mType;
|
||||
const TxFormat* mFormat;
|
||||
TxType mType;
|
||||
TxFormats::Item const* mFormat;
|
||||
|
||||
SerializedTransaction* duplicate () const
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user