"Advance" thread to publish ledgers and fetch history.

This commit is contained in:
JoelKatz
2013-08-11 13:44:04 -07:00
parent e8cfd1f586
commit a67f4fe9ba
7 changed files with 160 additions and 338 deletions

View File

@@ -235,9 +235,6 @@ static void LADispatch (
InboundLedger::pointer la,
std::vector< FUNCTION_TYPE<void (InboundLedger::pointer)> > trig)
{
Ledger::ref ledger = la->getLedger();
if (ledger)
getApp().getLedgerMaster().checkAccept (ledger->getHash(), ledger->getLedgerSeq());
for (unsigned int i = 0; i < trig.size (); ++i)
trig[i] (la);
}
@@ -272,8 +269,10 @@ void InboundLedger::done ()
getApp().getInboundLedgers ().logFailure (mHash);
// We hold the PeerSet lock, so must dispatch
getApp().getJobQueue ().addJob (jtLEDGER_DATA, "triggers",
BIND_TYPE (LADispatch, P_1, shared_from_this (), triggers));
if (!triggers.empty())
getApp().getJobQueue ().addJob (jtLEDGER_DATA, "triggers",
BIND_TYPE (LADispatch, P_1, shared_from_this (), triggers));
getApp().getLedgerMaster().tryAdvance();
}
bool InboundLedger::addOnComplete (FUNCTION_TYPE<void (InboundLedger::pointer)> trigger)