void closeLedger(vector<Simulation::TxInfo> txs) { auto baseFee = mApp->getConfig().DESIRED_BASE_FEE; TxSetFramePtr txSet = make_shared<TxSetFrame>(mApp->getLedgerManager().getLastClosedLedgerHeader().hash); for (auto& tx : txs) { txSet->add(tx.createPaymentTx()); tx.recordExecution(baseFee); } LedgerCloseData ledgerData(mApp->getLedgerManager().getLedgerNum(), txSet, VirtualClock::to_time_t(mApp->getClock().now()), baseFee); mApp->getLedgerManager().closeLedger(ledgerData); }
void closeLedger(vector<Simulation::TxInfo> txs) { auto baseFee = mApp->getConfig().DESIRED_BASE_FEE; LoadGenerator::TxMetrics txm(mApp->getMetrics()); TxSetFramePtr txSet = make_shared<TxSetFrame>( mApp->getLedgerManager().getLastClosedLedgerHeader().hash); for (auto& tx : txs) { std::vector<TransactionFramePtr> txfs; tx.toTransactionFrames(*mApp, txfs, txm); for (auto f : txfs) txSet->add(f); tx.recordExecution(baseFee); } StellarValue sv(txSet->getContentsHash(), VirtualClock::to_time_t(mApp->getClock().now()), emptyUpgradeSteps, 0); LedgerCloseData ledgerData(mApp->getLedgerManager().getLedgerNum(), txSet, sv); mApp->getLedgerManager().closeLedger(ledgerData); }