Skip to content

Commit 9745718

Browse files
authored
fix: Remove 'new parent hash' assert (#5313)
This assert is known to occasionally trigger, without causing errors downstream. It is replaced with a log message.
1 parent ab44cc3 commit 9745718

File tree

2 files changed

+7
-10
lines changed

2 files changed

+7
-10
lines changed

src/xrpld/app/misc/TxQ.h

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -785,13 +785,10 @@ class TxQ
785785
*/
786786
std::optional<size_t> maxSize_;
787787

788-
#if !NDEBUG
789788
/**
790-
parentHash_ checks that no unexpected ledger transitions
791-
happen, and is only checked via debug asserts.
789+
parentHash_ used for logging only
792790
*/
793791
LedgerHash parentHash_{beast::zero};
794-
#endif
795792

796793
/** Most queue operations are done under the master lock,
797794
but use this mutex for the RPC "fee" command, which isn't.

src/xrpld/app/misc/detail/TxQ.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1569,12 +1569,12 @@ TxQ::accept(Application& app, OpenView& view)
15691569
// parent hash, so that transactions paying the same fee are
15701570
// reordered.
15711571
LedgerHash const& parentHash = view.info().parentHash;
1572-
#if !NDEBUG
1573-
auto const startingSize = byFee_.size();
1574-
XRPL_ASSERT(
1575-
parentHash != parentHash_, "ripple::TxQ::accept : new parent hash");
1576-
parentHash_ = parentHash;
1577-
#endif
1572+
if (parentHash == parentHash_)
1573+
JLOG(j_.warn()) << "Parent ledger hash unchanged from " << parentHash;
1574+
else
1575+
parentHash_ = parentHash;
1576+
1577+
[[maybe_unused]] auto const startingSize = byFee_.size();
15781578
// byFee_ doesn't "own" the candidate objects inside it, so it's
15791579
// perfectly safe to wipe it and start over, repopulating from
15801580
// byAccount_.

0 commit comments

Comments
 (0)