Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: Factor out Transactor::trapTransaction #5087

Merged
merged 2 commits into from
Aug 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading