From 0a331ea72e6239b6990cbea419d81af74c6c4895 Mon Sep 17 00:00:00 2001 From: Bronek Kozicki Date: Mon, 5 Aug 2024 17:05:12 +0100 Subject: [PATCH] Factor out Transactor::trapTransaction (#5087) --- src/xrpld/app/tx/detail/Transactor.cpp | 10 +++++++++- src/xrpld/app/tx/detail/Transactor.h | 2 ++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/src/xrpld/app/tx/detail/Transactor.cpp b/src/xrpld/app/tx/detail/Transactor.cpp index 42e9f0677ab..6ae8be8a67f 100644 --- a/src/xrpld/app/tx/detail/Transactor.cpp +++ b/src/xrpld/app/tx/detail/Transactor.cpp @@ -825,6 +825,14 @@ Transactor::reset(XRPAmount fee) return {ter, fee}; } +// The sole purpose of this function is to provide a convenient, named +// location to set a breakpoint, to be used when replaying transactions. +void +Transactor::trapTransaction(uint256 txHash) const +{ + JLOG(j_.debug()) << "Transaction trapped: " << txHash; +} + //------------------------------------------------------------------------------ std::pair Transactor::operator()() @@ -857,7 +865,7 @@ Transactor::operator()() if (auto const& trap = ctx_.app.trapTxID(); trap && *trap == ctx_.tx.getTransactionID()) { - JLOG(j_.debug()) << "Transaction trapped: " << *trap; + trapTransaction(*trap); } auto result = ctx_.preclaimResult; diff --git a/src/xrpld/app/tx/detail/Transactor.h b/src/xrpld/app/tx/detail/Transactor.h index 27f22a0eb2e..c587e5e1994 100644 --- a/src/xrpld/app/tx/detail/Transactor.h +++ b/src/xrpld/app/tx/detail/Transactor.h @@ -198,6 +198,8 @@ class Transactor checkSingleSign(PreclaimContext const& ctx); static NotTEC checkMultiSign(PreclaimContext const& ctx); + + void trapTransaction(uint256) const; }; /** Performs early sanity checks on the txid */