Skip to content

Commit 4c67a5f

Browse files
Fix code review finding: use to_string for ConsensusMode attr
Replace hand-rolled ternary that missed switchedLedger with existing to_string(ConsensusMode) which handles all 4 enum values. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 7593627 commit 4c67a5f

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

src/xrpld/app/consensus/RCLConsensus.cpp

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -282,11 +282,7 @@ RCLConsensus::Adaptor::onClose(
282282
XRPL_TRACE_CONSENSUS(app_.getTelemetry(), "consensus.ledger_close");
283283
XRPL_TRACE_SET_ATTR(
284284
"xrpl.consensus.ledger.seq", static_cast<int64_t>(ledger.ledger_->header().seq + 1));
285-
XRPL_TRACE_SET_ATTR(
286-
"xrpl.consensus.mode",
287-
(mode == ConsensusMode::proposing
288-
? "proposing"
289-
: (mode == ConsensusMode::observing ? "observing" : "wrongLedger")));
285+
XRPL_TRACE_SET_ATTR("xrpl.consensus.mode", to_string(mode).c_str());
290286

291287
bool const wrongLCL = mode == ConsensusMode::wrongLedger;
292288
bool const proposing = mode == ConsensusMode::proposing;

0 commit comments

Comments
 (0)