Inject Application (cont.)

This commit is contained in:
Vinnie Falco
2015-09-15 19:10:16 -04:00
committed by Edward Hennis
parent eed1a891a7
commit ffbcb96eff
98 changed files with 708 additions and 570 deletions

View File

@@ -699,7 +699,7 @@ void NetworkOPsImp::submitTransaction (STTx::pointer iTrans)
}
auto tx = std::make_shared<Transaction> (
trans, Validate::NO, directSigVerify, reason);
trans, Validate::NO, directSigVerify, reason, app_);
m_job_queue.addJob (jtTRANSACTION, "submitTxn", [this, tx] (Job&) {
auto t = tx;
@@ -1316,7 +1316,8 @@ void NetworkOPsImp::switchLastClosedLedger (
clearNeedNetworkLedger ();
newLCL->setClosed ();
auto const newOL = std::make_shared<
Ledger>(open_ledger, std::ref (*newLCL));
Ledger>(open_ledger, std::ref (*newLCL),
app_.timeKeeper().closeTime());
// Caller must own master lock
{
auto const oldOL =
@@ -1746,7 +1747,7 @@ NetworkOPs::AccountTxs NetworkOPsImp::getAccountTxs (
txnMeta.clear ();
auto txn = Transaction::transactionFromSQL (
ledgerSeq, status, rawTxn, Validate::NO);
ledgerSeq, status, rawTxn, Validate::NO, app_);
if (txnMeta.empty ())
{ // Work around a bug that could leave the metadata missing
@@ -1824,15 +1825,17 @@ NetworkOPsImp::getTxsAccount (
{
static std::uint32_t const page_length (200);
Application& app = app_;
NetworkOPsImp::AccountTxs ret;
auto bound = [&ret](
auto bound = [&ret, &app](
std::uint32_t ledger_index,
std::string const& status,
Blob const& rawTxn,
Blob const& rawMeta)
{
convertBlobsToTxResult (ret, ledger_index, status, rawTxn, rawMeta);
convertBlobsToTxResult (
ret, ledger_index, status, rawTxn, rawMeta, app);
};
accountTxPage(app_.getTxnDB (), app_.accountIDCache(),
@@ -2099,7 +2102,8 @@ void NetworkOPsImp::pubProposedTransaction (
}
}
}
AcceptedLedgerTx alt (lpCurrent, stTxn, terResult);
AcceptedLedgerTx alt (lpCurrent, stTxn, terResult,
app_.accountIDCache());
m_journal.trace << "pubProposed: " << alt.getJson ();
pubAccountTransaction (lpCurrent, alt, false);
}
@@ -2113,7 +2117,8 @@ void NetworkOPsImp::pubLedger (Ledger::ref lpAccepted)
app_.getAcceptedLedgerCache().fetch (lpAccepted->info().hash);
if (! alpAccepted)
{
alpAccepted = std::make_shared<AcceptedLedger> (lpAccepted);
alpAccepted = std::make_shared<AcceptedLedger> (
lpAccepted, app_.accountIDCache());
app_.getAcceptedLedgerCache().canonicalize (
lpAccepted->info().hash, alpAccepted);
}