fix: Log transaction JSON on invariant failure

The fatal log emitted when finalizeInvariants returns false previously
lacked identifying information, making postmortems difficult. Include
the full transaction JSON, matching the global invariant checker.
This commit is contained in:
Vito
2026-04-22 10:00:13 +02:00
parent 50aa2603ec
commit 273f8a13cd

View File

@@ -1131,8 +1131,9 @@ Transactor::checkTransactionInvariants(TER result, XRPAmount fee)
// Phase 2: finalize
if (!this->finalizeInvariants(ctx_.tx, result, fee, ctx_.view(), ctx_.journal))
{
JLOG(ctx_.journal.fatal()) << //
"Transaction has failed one or more transaction invariants";
JLOG(ctx_.journal.fatal()) << //
"Transaction has failed one or more transaction invariants, tx: " << //
to_string(ctx_.tx.getJson(JsonOptions::none));
return tecINVARIANT_FAILED;
}
}