Skip to content

Commit c771fc0

Browse files
author
MarcoFalke
committed
Merge #21424: Net processing: Tidy up CNodeState ctor
6927933 [net processing] Add ChainSyncTimeoutState default initializers (John Newbery) 55966e0 [net processing] Remove CNodeState ctor body (John Newbery) Pull request description: This addresses the two outstanding review comments from #21370. ACKs for top commit: practicalswift: cr ACK 6927933: patch looks correct hebasto: ACK 6927933, I have reviewed the code and it looks OK, I agree it can be merged. Tree-SHA512: b3ef5c8a096e447887df255406b3a760f01c73e2b942374595416b4b4031fc69b89cd93168c45040489d581f340b2a62d3fbabd207d4307f587c00a7a7daacd1
2 parents 9a5e097 + 6927933 commit c771fc0

File tree

1 file changed

+6
-10
lines changed

1 file changed

+6
-10
lines changed

src/net_processing.cpp

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -575,16 +575,16 @@ struct CNodeState {
575575
*/
576576
struct ChainSyncTimeoutState {
577577
//! A timeout used for checking whether our peer has sufficiently synced
578-
int64_t m_timeout;
578+
int64_t m_timeout{0};
579579
//! A header with the work we require on our peer's chain
580-
const CBlockIndex * m_work_header;
580+
const CBlockIndex* m_work_header{nullptr};
581581
//! After timeout is reached, set to true after sending getheaders
582-
bool m_sent_getheaders;
582+
bool m_sent_getheaders{false};
583583
//! Whether this peer is protected from disconnection due to a bad/slow chain
584-
bool m_protect;
584+
bool m_protect{false};
585585
};
586586

587-
ChainSyncTimeoutState m_chain_sync{0, nullptr, false, false};
587+
ChainSyncTimeoutState m_chain_sync;
588588

589589
//! Time of last new block announcement
590590
int64_t m_last_block_announcement{0};
@@ -598,11 +598,7 @@ struct CNodeState {
598598
//! Whether this peer relays txs via wtxid
599599
bool m_wtxid_relay{false};
600600

601-
CNodeState(bool is_inbound)
602-
: m_is_inbound(is_inbound)
603-
{
604-
m_recently_announced_invs.reset();
605-
}
601+
CNodeState(bool is_inbound) : m_is_inbound(is_inbound) {}
606602
};
607603

608604
/** Map maintaining per-node state. */

0 commit comments

Comments
 (0)