Factor out Transactor::trapTransaction (#5087)

This commit is contained in:
Bronek Kozicki
2024-08-05 17:05:12 +01:00
committed by tequ
parent d27bc94249
commit fd1908f5b6
2 changed files with 11 additions and 1 deletions

View File

@@ -1753,6 +1753,14 @@ Transactor::doAgainAsWeak(
}
}
// 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()()
@@ -1795,7 +1803,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

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