Skip to content

Commit

Permalink
refactor: modernize-use-default-member-init for bit-fields (C++20)
Browse files Browse the repository at this point in the history
  • Loading branch information
MarcoFalke committed Dec 7, 2023
1 parent fa67f09 commit fa02fc0
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/txrequest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ struct Announcement {
const bool m_is_wtxid : 1;

/** What state this announcement is in. */
State m_state : 3;
State m_state : 3 {State::CANDIDATE_DELAYED};
State GetState() const { return m_state; }
void SetState(State state) { m_state = state; }

Expand All @@ -97,9 +97,9 @@ struct Announcement {

/** Construct a new announcement from scratch, initially in CANDIDATE_DELAYED state. */
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{State::CANDIDATE_DELAYED} {}
SequenceNumber sequence)
: m_txhash(gtxid.GetHash()), m_time(reqtime), m_peer(peer), m_sequence(sequence), m_preferred(preferred),
m_is_wtxid{gtxid.IsWtxid()} {}
};

//! Type alias for priorities.
Expand Down

0 comments on commit fa02fc0

Please sign in to comment.