mirror of
https://github.com/XRPLF/rippled.git
synced 2025-12-06 17:27:55 +00:00
Fix a race applying connections to the open ledger.
This commit is contained in:
@@ -74,10 +74,10 @@ void LedgerMaster::switchLedgers(Ledger::pointer lastClosed, Ledger::pointer cur
|
|||||||
mFinalizedLedger->setClosed();
|
mFinalizedLedger->setClosed();
|
||||||
mFinalizedLedger->setAccepted();
|
mFinalizedLedger->setAccepted();
|
||||||
mCurrentLedger = current;
|
mCurrentLedger = current;
|
||||||
}
|
|
||||||
|
|
||||||
assert(!mCurrentLedger->isClosed());
|
assert(!mCurrentLedger->isClosed());
|
||||||
mEngine.setLedger(mCurrentLedger);
|
mEngine.setLedger(mCurrentLedger);
|
||||||
|
}
|
||||||
checkAccept(lastClosed->getHash(), lastClosed->getLedgerSeq());
|
checkAccept(lastClosed->getHash(), lastClosed->getLedgerSeq());
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -122,6 +122,7 @@ Ledger::pointer LedgerMaster::closeLedger(bool recover)
|
|||||||
|
|
||||||
TER LedgerMaster::doTransaction(SerializedTransaction::ref txn, TransactionEngineParams params, bool& didApply)
|
TER LedgerMaster::doTransaction(SerializedTransaction::ref txn, TransactionEngineParams params, bool& didApply)
|
||||||
{
|
{
|
||||||
|
boost::recursive_mutex::scoped_lock sl(mLock);
|
||||||
TER result = mEngine.applyTransaction(*txn, params, didApply);
|
TER result = mEngine.applyTransaction(*txn, params, didApply);
|
||||||
// if (didApply)
|
// if (didApply)
|
||||||
theApp->getOPs().pubProposedTransaction(mEngine.getLedger(), txn, result);
|
theApp->getOPs().pubProposedTransaction(mEngine.getLedger(), txn, result);
|
||||||
|
|||||||
Reference in New Issue
Block a user