Skip to content

Commit

Permalink
Factor out Transactor::trapTransaction (#5087)
Browse files Browse the repository at this point in the history
  • Loading branch information
Bronek authored Aug 5, 2024
1 parent 7d27b11 commit 0a331ea
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/xrpld/app/tx/detail/Transactor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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()()
Expand Down Expand Up @@ -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;
Expand Down
2 changes: 2 additions & 0 deletions src/xrpld/app/tx/detail/Transactor.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down

0 comments on commit 0a331ea

Please sign in to comment.