diff --git a/src/xrpld/app/consensus/RCLConsensus.cpp b/src/xrpld/app/consensus/RCLConsensus.cpp index 5313c0691a..525f437615 100644 --- a/src/xrpld/app/consensus/RCLConsensus.cpp +++ b/src/xrpld/app/consensus/RCLConsensus.cpp @@ -66,14 +66,9 @@ #include #include #include -#include // IWYU pragma: keep #include -#ifdef XRPL_ENABLE_TELEMETRY -#include -#endif - #include #include diff --git a/src/xrpld/consensus/Consensus.h b/src/xrpld/consensus/Consensus.h index 25e0884a64..45d92714c9 100644 --- a/src/xrpld/consensus/Consensus.h +++ b/src/xrpld/consensus/Consensus.h @@ -700,6 +700,10 @@ Consensus::startRoundInternal( CLOG(clog) << "startRoundInternal transitioned to ConsensusPhase::open, " "previous ledgerID: " << prevLedgerID << ", seq: " << prevLedger.seq() << ". "; + // Reset establishSpan_ so a wrongLedger recovery mid-establish doesn't + // leak the prior round's span into the new one (startEstablishTracing + // early-returns when establishSpan_ is populated). + establishSpan_.reset(); openSpan_.emplace( telemetry::SpanGuard::span( telemetry::TraceCategory::Consensus,