mirror of
https://github.com/XRPLF/rippled.git
synced 2025-12-06 17:27:55 +00:00
Batched transaction application:
Applying multiple transactions to the open ledger reduces SHAMap modification overhead.
This commit is contained in:
committed by
Nik Bougalis
parent
4225b78bf5
commit
ca800f9e8d
@@ -79,7 +79,7 @@ public:
|
||||
static
|
||||
TransStatus
|
||||
sqlTransactionStatus(boost::optional<std::string> const& status);
|
||||
|
||||
|
||||
bool checkSign (std::string&) const;
|
||||
|
||||
STTx::ref getSTransaction ()
|
||||
@@ -124,6 +124,32 @@ public:
|
||||
mInLedger = ledger;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set this flag once added to a batch.
|
||||
*/
|
||||
void setApplying()
|
||||
{
|
||||
mApplying = true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Detect if transaction is being batched.
|
||||
*
|
||||
* @return Whether transaction is being applied within a batch.
|
||||
*/
|
||||
bool getApplying()
|
||||
{
|
||||
return mApplying;
|
||||
}
|
||||
|
||||
/**
|
||||
* Indicate that transaction application has been attempted.
|
||||
*/
|
||||
void clearApplying()
|
||||
{
|
||||
mApplying = false;
|
||||
}
|
||||
|
||||
Json::Value getJson (int options, bool binary = false) const;
|
||||
|
||||
static Transaction::pointer load (uint256 const& id);
|
||||
@@ -134,9 +160,10 @@ private:
|
||||
RippleAddress mFromPubKey; // Sign transaction with this. mSignPubKey
|
||||
RippleAddress mSourcePrivate; // Sign transaction with this.
|
||||
|
||||
LedgerIndex mInLedger;
|
||||
TransStatus mStatus;
|
||||
TER mResult;
|
||||
LedgerIndex mInLedger = 0;
|
||||
TransStatus mStatus = INVALID;
|
||||
TER mResult = temUNCERTAIN;
|
||||
bool mApplying = false;
|
||||
|
||||
STTx::pointer mTransaction;
|
||||
};
|
||||
|
||||
@@ -30,10 +30,7 @@ namespace ripple {
|
||||
|
||||
Transaction::Transaction (STTx::ref sit, Validate validate, std::string& reason)
|
||||
noexcept
|
||||
: mInLedger (0),
|
||||
mStatus (INVALID),
|
||||
mResult (temUNCERTAIN),
|
||||
mTransaction (sit)
|
||||
: mTransaction (sit)
|
||||
{
|
||||
try
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user