mirror of
https://github.com/XRPLF/rippled.git
synced 2025-12-06 17:27:55 +00:00
Call NetworkOPs::pubTransaction.
This commit is contained in:
@@ -91,4 +91,14 @@ Ledger::pointer LedgerMaster::endWobble()
|
||||
return ret;
|
||||
}
|
||||
|
||||
TransactionEngineResult LedgerMaster::doTransaction(const SerializedTransaction& txn, uint32 targetLedger,
|
||||
TransactionEngineParams params)
|
||||
{
|
||||
Ledger::pointer ledger = mEngine.getTransactionLedger(targetLedger);
|
||||
TransactionEngineResult result = mEngine.applyTransaction(txn, params, ledger);
|
||||
theApp->getOPs().pubTransaction(ledger, txn, result);
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
// vim:ts=4
|
||||
|
||||
@@ -48,8 +48,7 @@ public:
|
||||
Ledger::pointer getClosedLedger() { return mFinalizedLedger; }
|
||||
|
||||
TransactionEngineResult doTransaction(const SerializedTransaction& txn, uint32 targetLedger,
|
||||
TransactionEngineParams params)
|
||||
{ return mEngine.applyTransaction(txn, params, targetLedger); }
|
||||
TransactionEngineParams params);
|
||||
|
||||
void pushLedger(Ledger::pointer newLedger);
|
||||
void pushLedger(Ledger::pointer newLCL, Ledger::pointer newOL);
|
||||
|
||||
@@ -763,8 +763,9 @@ void NetworkOPs::pubLedger(const Ledger::pointer& lpAccepted)
|
||||
}
|
||||
}
|
||||
|
||||
void NetworkOPs::pubTransaction(const Ledger::pointer& lpCurrent, const SerializedTransaction& stTxn, TransactionEngineResult terResult, const std::vector<NewcoinAddress>& naAffectedAccountIds)
|
||||
void NetworkOPs::pubTransaction(const Ledger::pointer& lpCurrent, const SerializedTransaction& stTxn, TransactionEngineResult terResult)
|
||||
{
|
||||
// std::vector<NewcoinAddress> affectedAccounts = stTxn.getAffectedAccounts();
|
||||
boost::interprocess::scoped_lock<boost::interprocess::interprocess_upgradable_mutex> sl(mMonitorLock);
|
||||
if (!mSubTransaction.empty())
|
||||
{
|
||||
|
||||
@@ -165,7 +165,7 @@ public:
|
||||
|
||||
void pubAccountInfo(const NewcoinAddress& naAccountID, const Json::Value& jvObj);
|
||||
void pubLedger(const Ledger::pointer& lpAccepted);
|
||||
void pubTransaction(const Ledger::pointer& lpCurrent, const SerializedTransaction& stTxn, TransactionEngineResult terResult, const std::vector<NewcoinAddress>& naAffectedAccountIds);
|
||||
void pubTransaction(const Ledger::pointer& lpLedger, const SerializedTransaction& stTxn, TransactionEngineResult terResult);
|
||||
|
||||
//
|
||||
// Monitoring: subscriber side
|
||||
|
||||
@@ -289,19 +289,29 @@ TransactionEngineResult TransactionEngine::setAuthorized(const SerializedTransac
|
||||
return terSUCCESS;
|
||||
}
|
||||
|
||||
TransactionEngineResult TransactionEngine::applyTransaction(const SerializedTransaction& txn,
|
||||
TransactionEngineParams params, uint32 targetLedger)
|
||||
Ledger::pointer TransactionEngine::getTransactionLedger(uint32 targetLedger)
|
||||
{
|
||||
Log(lsTRACE) << "applyTransaction>";
|
||||
|
||||
mLedger = mDefaultLedger;
|
||||
assert(mLedger);
|
||||
Ledger::pointer ledger = mDefaultLedger;
|
||||
if (mAlternateLedger && (targetLedger != 0) &&
|
||||
(targetLedger != mLedger->getLedgerSeq()) && (targetLedger == mAlternateLedger->getLedgerSeq()))
|
||||
{
|
||||
Log(lsINFO) << "Transaction goes into wobble ledger";
|
||||
mLedger = mAlternateLedger;
|
||||
ledger = mAlternateLedger;
|
||||
}
|
||||
return ledger;
|
||||
}
|
||||
|
||||
TransactionEngineResult TransactionEngine::applyTransaction(const SerializedTransaction& txn,
|
||||
TransactionEngineParams params, uint32 targetLedger)
|
||||
{
|
||||
return applyTransaction(txn, params, getTransactionLedger(targetLedger));
|
||||
}
|
||||
|
||||
TransactionEngineResult TransactionEngine::applyTransaction(const SerializedTransaction& txn,
|
||||
TransactionEngineParams params, Ledger::pointer ledger)
|
||||
{
|
||||
Log(lsTRACE) << "applyTransaction>";
|
||||
mLedger = ledger;
|
||||
|
||||
#ifdef DEBUG
|
||||
if (1)
|
||||
|
||||
@@ -136,6 +136,9 @@ public:
|
||||
void setLedger(Ledger::pointer ledger) { mDefaultLedger = ledger;
|
||||
mAlternateLedger = Ledger::pointer(); }
|
||||
|
||||
Ledger::pointer getTransactionLedger(uint32 targetLedger);
|
||||
TransactionEngineResult applyTransaction(const SerializedTransaction&, TransactionEngineParams,
|
||||
Ledger::pointer ledger);
|
||||
TransactionEngineResult applyTransaction(const SerializedTransaction&, TransactionEngineParams,
|
||||
uint32 targetLedger);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user