Skip to content

Commit fa02fc0

Browse files
author
MarcoFalke
committed
refactor: modernize-use-default-member-init for bit-fields (C++20)
1 parent fa67f09 commit fa02fc0

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/txrequest.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ struct Announcement {
7373
const bool m_is_wtxid : 1;
7474

7575
/** What state this announcement is in. */
76-
State m_state : 3;
76+
State m_state : 3 {State::CANDIDATE_DELAYED};
7777
State GetState() const { return m_state; }
7878
void SetState(State state) { m_state = state; }
7979

@@ -97,9 +97,9 @@ struct Announcement {
9797

9898
/** Construct a new announcement from scratch, initially in CANDIDATE_DELAYED state. */
9999
Announcement(const GenTxid& gtxid, NodeId peer, bool preferred, std::chrono::microseconds reqtime,
100-
SequenceNumber sequence) :
101-
m_txhash(gtxid.GetHash()), m_time(reqtime), m_peer(peer), m_sequence(sequence), m_preferred(preferred),
102-
m_is_wtxid{gtxid.IsWtxid()}, m_state{State::CANDIDATE_DELAYED} {}
100+
SequenceNumber sequence)
101+
: m_txhash(gtxid.GetHash()), m_time(reqtime), m_peer(peer), m_sequence(sequence), m_preferred(preferred),
102+
m_is_wtxid{gtxid.IsWtxid()} {}
103103
};
104104

105105
//! Type alias for priorities.

0 commit comments

Comments
 (0)