mirror of
https://github.com/XRPLF/rippled.git
synced 2025-12-06 17:27:55 +00:00
Refactor TxFormats and fix leak on exit
This commit is contained in:
@@ -1269,12 +1269,10 @@ UPTR_T<STObject> STObject::parseJson (const Json::Value& object, SField::ref inN
|
||||
{
|
||||
if (field == sfTransactionType)
|
||||
{
|
||||
TxFormat* f = TxFormats::getInstance ().findByName (strValue);
|
||||
// Retrieve type from name. Throws if not found.
|
||||
TxType const txType = TxFormats::getInstance().findTypeByName (strValue);
|
||||
|
||||
if (!f)
|
||||
throw std::runtime_error ("Unknown transaction type");
|
||||
|
||||
data.push_back (new STUInt16 (field, static_cast<uint16> (f->getType ())));
|
||||
data.push_back (new STUInt16 (field, static_cast<uint16> (txType)));
|
||||
|
||||
if (*name == sfGeneric)
|
||||
name = &sfTransaction;
|
||||
|
||||
Reference in New Issue
Block a user