Batched transaction application:

Applying multiple transactions to the open ledger
reduces SHAMap modification overhead.
This commit is contained in:
Mark Travis
2015-05-29 00:09:44 -07:00
committed by Nik Bougalis
parent 4225b78bf5
commit ca800f9e8d
11 changed files with 370 additions and 172 deletions

View File

@@ -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;
};

View File

@@ -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
{