Skip to content
This repository has been archived by the owner on Aug 2, 2022. It is now read-only.

Init net_plugin member variables - develop #8618

Merged
merged 1 commit into from
Feb 12, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 13 additions & 13 deletions plugins/net_plugin/include/eosio/net_plugin/protocol.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -77,16 +77,16 @@ namespace eosio {
}

struct go_away_message {
go_away_message (go_away_reason r = no_reason) : reason(r), node_id() {}
go_away_reason reason;
go_away_message(go_away_reason r = no_reason) : reason(r), node_id() {}
go_away_reason reason{no_reason};
fc::sha256 node_id; ///< for duplicate notification
};

struct time_message {
tstamp org; //!< origin timestamp
tstamp rec; //!< receive timestamp
tstamp xmt; //!< transmit timestamp
mutable tstamp dst; //!< destination timestamp
tstamp org{0}; //!< origin timestamp
tstamp rec{0}; //!< receive timestamp
tstamp xmt{0}; //!< transmit timestamp
mutable tstamp dst{0}; //!< destination timestamp
};

enum id_list_modes {
Expand All @@ -108,9 +108,9 @@ namespace eosio {

template<typename T>
struct select_ids {
select_ids () : mode(none),pending(0),ids() {}
id_list_modes mode;
uint32_t pending;
select_ids() : mode(none),pending(0),ids() {}
id_list_modes mode{none};
uint32_t pending{0};
vector<T> ids;
bool empty () const { return (mode == none || ids.empty()); }
};
Expand All @@ -119,20 +119,20 @@ namespace eosio {
using ordered_blk_ids = select_ids<block_id_type>;

struct notice_message {
notice_message () : known_trx(), known_blocks() {}
notice_message() : known_trx(), known_blocks() {}
ordered_txn_ids known_trx;
ordered_blk_ids known_blocks;
};

struct request_message {
request_message () : req_trx(), req_blocks() {}
request_message() : req_trx(), req_blocks() {}
ordered_txn_ids req_trx;
ordered_blk_ids req_blocks;
};

struct sync_request_message {
uint32_t start_block;
uint32_t end_block;
uint32_t start_block{0};
uint32_t end_block{0};
};

using net_message = static_variant<handshake_message,
Expand Down
16 changes: 8 additions & 8 deletions plugins/net_plugin/net_plugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -138,12 +138,12 @@ namespace eosio {
};

mutable std::mutex sync_mtx;
uint32_t sync_known_lib_num;
uint32_t sync_last_requested_num;
uint32_t sync_next_expected_num;
uint32_t sync_req_span;
uint32_t sync_known_lib_num{0};
uint32_t sync_last_requested_num{0};
uint32_t sync_next_expected_num{0};
uint32_t sync_req_span{0};
connection_ptr sync_source;
std::atomic<stages> sync_state;
std::atomic<stages> sync_state{in_sync};

private:
constexpr static auto stage_str( stages s );
Expand Down Expand Up @@ -229,9 +229,9 @@ namespace eosio {
};
possible_connections allowed_connections{None};

boost::asio::steady_timer::duration connector_period;
boost::asio::steady_timer::duration txn_exp_period;
boost::asio::steady_timer::duration resp_expected_period;
boost::asio::steady_timer::duration connector_period{0};
boost::asio::steady_timer::duration txn_exp_period{0};
boost::asio::steady_timer::duration resp_expected_period{0};
boost::asio::steady_timer::duration keepalive_interval{std::chrono::seconds{32}};

int max_cleanup_time_ms = 0;
Expand Down