From fa5423b5b582aaf8c5b7c516806157244cf20c74 Mon Sep 17 00:00:00 2001 From: MarcoFalke <*~=`'#}+{/-|&$^_@721217.xyz> Date: Sun, 27 Aug 2023 09:53:24 +0200 Subject: [PATCH] refactor: Remove unused gcc-9 workaround in txrequest --- src/txrequest.cpp | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/src/txrequest.cpp b/src/txrequest.cpp index 4c94d4562dc..b9a41f26ffa 100644 --- a/src/txrequest.cpp +++ b/src/txrequest.cpp @@ -72,16 +72,10 @@ struct Announcement { /** Whether this is a wtxid request. */ const bool m_is_wtxid : 1; - /** What state this announcement is in. - * This is a uint8_t instead of a State to silence a GCC warning in versions prior to 9.3. - * See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61414 */ - uint8_t m_state : 3; - - /** Convert m_state to a State enum. */ - State GetState() const { return static_cast(m_state); } - - /** Convert a State enum to a uint8_t and store it in m_state. */ - void SetState(State state) { m_state = static_cast(state); } + /** What state this announcement is in. */ + State m_state : 3; + State GetState() const { return m_state; } + void SetState(State state) { m_state = state; } /** Whether this announcement is selected. There can be at most 1 selected peer per txhash. */ bool IsSelected() const @@ -105,7 +99,7 @@ struct Announcement { Announcement(const GenTxid& gtxid, NodeId peer, bool preferred, std::chrono::microseconds reqtime, SequenceNumber sequence) : m_txhash(gtxid.GetHash()), m_time(reqtime), m_peer(peer), m_sequence(sequence), m_preferred(preferred), - m_is_wtxid(gtxid.IsWtxid()), m_state(static_cast(State::CANDIDATE_DELAYED)) {} + m_is_wtxid{gtxid.IsWtxid()}, m_state{State::CANDIDATE_DELAYED} {} }; //! Type alias for priorities.