aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcoFalke <falke.marco@gmail.com>2021-03-15 17:36:13 +0100
committerMarcoFalke <falke.marco@gmail.com>2021-03-15 17:36:16 +0100
commitc771fc0dc1bcb48fc6aa77b61c1ff31742ac8bb7 (patch)
tree20fb6fd97f593b777a4179ca8a48c111d791fd92
parent9a5e097435a3172bb5f31b8f1e4948a7c69df5c9 (diff)
parent6927933782acb9b158787e6f35debb916793f6b1 (diff)
downloadbitcoin-c771fc0dc1bcb48fc6aa77b61c1ff31742ac8bb7.tar.xz
Merge #21424: Net processing: Tidy up CNodeState ctor
6927933782acb9b158787e6f35debb916793f6b1 [net processing] Add ChainSyncTimeoutState default initializers (John Newbery) 55966e0cc03f0e380d21a9434b048d4d515b6729 [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 6927933782acb9b158787e6f35debb916793f6b1: patch looks correct hebasto: ACK 6927933782acb9b158787e6f35debb916793f6b1, I have reviewed the code and it looks OK, I agree it can be merged. Tree-SHA512: b3ef5c8a096e447887df255406b3a760f01c73e2b942374595416b4b4031fc69b89cd93168c45040489d581f340b2a62d3fbabd207d4307f587c00a7a7daacd1
-rw-r--r--src/net_processing.cpp16
1 files changed, 6 insertions, 10 deletions
diff --git a/src/net_processing.cpp b/src/net_processing.cpp
index c569acd3cb..6ce984348c 100644
--- a/src/net_processing.cpp
+++ b/src/net_processing.cpp
@@ -575,16 +575,16 @@ struct CNodeState {
*/
struct ChainSyncTimeoutState {
//! A timeout used for checking whether our peer has sufficiently synced
- int64_t m_timeout;
+ int64_t m_timeout{0};
//! A header with the work we require on our peer's chain
- const CBlockIndex * m_work_header;
+ const CBlockIndex* m_work_header{nullptr};
//! After timeout is reached, set to true after sending getheaders
- bool m_sent_getheaders;
+ bool m_sent_getheaders{false};
//! Whether this peer is protected from disconnection due to a bad/slow chain
- bool m_protect;
+ bool m_protect{false};
};
- ChainSyncTimeoutState m_chain_sync{0, nullptr, false, false};
+ ChainSyncTimeoutState m_chain_sync;
//! Time of last new block announcement
int64_t m_last_block_announcement{0};
@@ -598,11 +598,7 @@ struct CNodeState {
//! Whether this peer relays txs via wtxid
bool m_wtxid_relay{false};
- CNodeState(bool is_inbound)
- : m_is_inbound(is_inbound)
- {
- m_recently_announced_invs.reset();
- }
+ CNodeState(bool is_inbound) : m_is_inbound(is_inbound) {}
};
/** Map maintaining per-node state. */