diff --git a/src/ripple/app/hook/impl/applyHook.cpp b/src/ripple/app/hook/impl/applyHook.cpp
index d831f5f68..41a56a758 100644
--- a/src/ripple/app/hook/impl/applyHook.cpp
+++ b/src/ripple/app/hook/impl/applyHook.cpp
@@ -1857,7 +1857,8 @@ hook::finalizeHookResult(
uint16_t exec_index = avi.nextHookExecutionIndex();
// apply emitted transactions to the ledger (by adding them to the emitted
// directory) if we are allowed to
- std::map emission_txnid;
+ std::vector>
+ emission_txnid;
if (doEmit)
{
@@ -1882,7 +1883,7 @@ hook::finalizeHookResult(
.getField(sfEmitDetails)
.downcast();
- emission_txnid.emplace(
+ emission_txnid.emplace_back(
id, emitDetails.getFieldH256(sfEmitNonce));
sleEmitted = std::make_shared(emittedId);
diff --git a/src/ripple/app/ledger/LedgerHistory.cpp b/src/ripple/app/ledger/LedgerHistory.cpp
index 53c723e14..b23988985 100644
--- a/src/ripple/app/ledger/LedgerHistory.cpp
+++ b/src/ripple/app/ledger/LedgerHistory.cpp
@@ -386,6 +386,17 @@ LedgerHistory::handleMismatch(
JLOG(j_.error()) << "built\n" << getJson({*builtLedger, {}});
JLOG(j_.error()) << "valid\n" << getJson({*validLedger, {}});
+ {
+ auto b = builtTx.begin();
+ auto v = validTx.begin();
+ while (b != builtTx.end() && v != validTx.end())
+ {
+ log_one(*builtLedger, (*b)->key(), "validInfo", j_);
+ log_one(*validLedger, (*v)->key(), "builtInfo", j_);
+ ++b;
+ ++v;
+ }
+ }
// Log all differences between built and valid ledgers
auto b = builtTx.begin();
auto v = validTx.begin();