Fix Replace assert with XRPL_ASSERT (#5312)

This commit is contained in:
Bronek Kozicki
2026-02-20 04:00:46 +09:00
committed by tequ
parent 8b45539f9c
commit 14edb034bb
2 changed files with 12 additions and 5 deletions

View File

@@ -226,7 +226,10 @@ public:
toBase58(TokenType::NodePublic, votes.first);
if (!votes.second.timeout)
{
assert(votes.second.upVotes.empty());
XRPL_ASSERT(
votes.second.upVotes.empty(),
"ripple::TrustedVotes::recordVotes : received no "
"upvotes");
JLOG(j.debug())
<< "recordVotes: Have not received any "
"amendment votes from "
@@ -242,7 +245,10 @@ public:
}
else if (votes.second.timeout != newTimeout)
{
assert(votes.second.timeout < newTimeout);
XRPL_ASSERT(
votes.second.timeout < newTimeout,
"ripple::TrustedVotes::recordVotes : votes not "
"expired");
using namespace std::chrono;
auto const age = duration_cast<minutes>(
newTimeout - *votes.second.timeout);
@@ -262,9 +268,10 @@ public:
int available = 0;
for (auto& validatorVotes : recordedVotes_)
{
assert(
XRPL_ASSERT(
validatorVotes.second.timeout ||
validatorVotes.second.upVotes.empty());
validatorVotes.second.upVotes.empty(),
"ripple::TrustedVotes::getVotes : valid votes");
if (validatorVotes.second.timeout)
++available;
for (uint256 const& amendment : validatorVotes.second.upVotes)

View File

@@ -1246,7 +1246,7 @@ PeerImp::handleTransaction(
{
XRPL_ASSERT(
eraseTxQueue != batch,
"ripple::PeerImp::handleTransaction correct function params");
("ripple::PeerImp::handleTransaction : valid inputs"));
if (tracking_.load() == Tracking::diverged)
return;