Factor out Transactor::trapTransaction (#5087)

This commit is contained in:
Bronek Kozicki
2024-08-05 17:05:12 +01:00
committed by GitHub
parent 7d27b11190
commit 0a331ea72e
2 changed files with 11 additions and 1 deletions

View File

@@ -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<TER, bool>
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;

View File

@@ -198,6 +198,8 @@ private:
checkSingleSign(PreclaimContext const& ctx);
static NotTEC
checkMultiSign(PreclaimContext const& ctx);
void trapTransaction(uint256) const;
};
/** Performs early sanity checks on the txid */