Process batch during OpenLedger::modify

This commit is contained in:
JoelKatz
2015-10-15 15:26:08 -07:00
committed by Vinnie Falco
parent 3e8e2c2fee
commit 0622e4fd44

View File

@@ -832,25 +832,25 @@ void NetworkOPsImp::apply (std::unique_lock<std::mutex>& batchLock)
std::lock_guard <std::recursive_mutex> lock ( std::lock_guard <std::recursive_mutex> lock (
m_ledgerMaster.peekMutex()); m_ledgerMaster.peekMutex());
for (TransactionStatus& e : transactions) app_.openLedger().modify(
[&](OpenView& view, beast::Journal j)
{ {
ApplyFlags flags = tapNONE; bool changed = false;
// All code paths to this point are gated by validity checks. for (TransactionStatus& e : transactions)
flags = flags | tapNO_CHECK_SIGN; {
if (e.admin) // we check before addingto the batch
flags = flags | tapADMIN; ApplyFlags flags = tapNO_CHECK_SIGN;
if (e.admin)
flags = flags | tapADMIN;
// VFALCO Should do the loop inside modify() auto const result = ripple::apply(app_, view,
app_.openLedger().modify( *e.transaction->getSTransaction(), flags, j);
[&](OpenView& view, beast::Journal j) e.result = result.first;
{ e.applied = result.second;
auto const result = ripple::apply(app_, view, changed = changed || result.second;
*e.transaction->getSTransaction(), flags, j); }
e.result = result.first; return changed;
e.applied = result.second; });
return result.second;
});
}
} }
auto newOL = app_.openLedger().current(); auto newOL = app_.openLedger().current();