Fix the deadlock. Can't hold the LedgerMaster lock when calling a pub* function.

This commit is contained in:
JoelKatz
2013-04-03 14:17:06 -07:00
parent 1894b2d4b8
commit 88dba87fa9

View File

@@ -122,10 +122,13 @@ Ledger::pointer LedgerMaster::closeLedger(bool recover)
TER LedgerMaster::doTransaction(SerializedTransaction::ref txn, TransactionEngineParams params, bool& didApply)
{
boost::recursive_mutex::scoped_lock sl(mLock);
TER result = mEngine.applyTransaction(*txn, params, didApply);
{
boost::recursive_mutex::scoped_lock sl(mLock);
TER result = mEngine.applyTransaction(*txn, params, didApply);
Ledger::pointer ledger = mEngine.getLedger();
}
// if (didApply)
theApp->getOPs().pubProposedTransaction(mEngine.getLedger(), txn, result);
theApp->getOPs().pubProposedTransaction(ledger, txn, result);
return result;
}