mirror of
https://github.com/Xahau/xahaud.git
synced 2026-07-27 09:00:09 +00:00
fix(ledger): preserve parent context during live apply
This commit is contained in:
@@ -100,6 +100,7 @@ buildLedgerImpl(
|
||||
std::size_t
|
||||
applyTransactions(
|
||||
Application& app,
|
||||
std::shared_ptr<Ledger const> const& parent,
|
||||
std::shared_ptr<Ledger const> const& built,
|
||||
CanonicalTXSet& txns,
|
||||
std::set<TxID>& failed,
|
||||
@@ -109,7 +110,7 @@ applyTransactions(
|
||||
bool certainRetry = true;
|
||||
std::size_t count = 0;
|
||||
|
||||
ApplyOptions const applyOptions{};
|
||||
ApplyOptions const applyOptions{parent};
|
||||
|
||||
//@@start rng-entropy-first-application
|
||||
// CRITICAL: Apply consensus entropy pseudo-tx FIRST before any other
|
||||
@@ -257,8 +258,8 @@ buildLedger(
|
||||
JLOG(j.debug())
|
||||
<< "Attempting to apply " << txns.size() << " transactions";
|
||||
|
||||
auto const applied =
|
||||
applyTransactions(app, built, txns, failedTxns, accum, j);
|
||||
auto const applied = applyTransactions(
|
||||
app, parent, built, txns, failedTxns, accum, j);
|
||||
|
||||
if (!txns.empty() || !failedTxns.empty())
|
||||
JLOG(j.debug()) << "Applied " << applied << " transactions; "
|
||||
|
||||
@@ -19,7 +19,6 @@
|
||||
|
||||
#include <xrpld/app/hook/applyHook.h>
|
||||
#include <xrpld/app/ledger/Ledger.h>
|
||||
#include <xrpld/app/ledger/LedgerMaster.h>
|
||||
#include <xrpld/app/main/Application.h>
|
||||
#include <xrpld/app/misc/AmendmentTable.h>
|
||||
#include <xrpld/app/misc/NetworkOPs.h>
|
||||
@@ -379,10 +378,7 @@ Change::applyExportSignatures()
|
||||
|
||||
auto const account = signingPayload->getAccountID(sfAccount);
|
||||
auto const latchKey = keylet::exportLatch(account, origin);
|
||||
auto parent = ctx_.replayParentLedger();
|
||||
if (!parent)
|
||||
parent = ctx_.app.getLedgerMaster().getLedgerByHash(
|
||||
view().info().parentHash);
|
||||
auto const parent = ctx_.replayParentLedger();
|
||||
if (!parent || parent->info().hash != view().info().parentHash)
|
||||
return tefBAD_LEDGER;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user