We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 334f44f commit 70948c2Copy full SHA for 70948c2
include/bitcoin/node/channels/channel.hpp
@@ -36,8 +36,8 @@ class BCN_API channel
36
DELETE_COPY_MOVE_DESTRUCT(channel);
37
38
protected:
39
- channel(const network::logger&, const network::socket::ptr&,
40
- const node::configuration&, uint64_t=zero) NOEXCEPT
+ channel(const network::logger&, const network::socket::ptr&, uint64_t,
+ const node::configuration&) NOEXCEPT
41
{
42
}
43
};
include/bitcoin/node/channels/channel_http.hpp
@@ -34,13 +34,12 @@ class BCN_API channel_http
34
35
public:
typedef std::shared_ptr<node::channel_http> ptr;
- using options_t = network::channel_http::options_t;
- channel_http(const network::logger& log, const network::socket::ptr& socket,
- const node::configuration& config, uint64_t identifier=zero,
- const options_t& options={}) NOEXCEPT
- : network::channel_http(log, socket, config.network, identifier, options),
- node::channel(log, socket, config, identifier)
+ channel_http(const network::logger& log,
+ const network::socket::ptr& socket, uint64_t identifier,
+ const node::configuration& config, const options_t& options) NOEXCEPT
+ : network::channel_http(log, socket, identifier, config.network, options),
+ node::channel(log, socket, identifier, config)
44
45
46
include/bitcoin/node/channels/channel_peer.hpp
@@ -35,11 +35,12 @@ class BCN_API channel_peer
typedef std::shared_ptr<node::channel_peer> ptr;
- channel_peer(network::memory& memory, const network::logger& log,
- const network::socket::ptr& socket, const node::configuration& config,
- uint64_t identifier=zero) NOEXCEPT
- : network::channel_peer(memory, log, socket, config.network, identifier),
- node::channel(log, socket, config, identifier),
+ channel_peer(network::memory& allocator, const network::logger& log,
+ : network::channel_peer(allocator, log, socket, identifier,
+ config.network, options),
+ node::channel(log, socket, identifier, config),
announced_(config.node.announcement_cache)
include/bitcoin/node/channels/channel_tcp.hpp
@@ -34,13 +34,12 @@ class BCN_API channel_tcp
typedef std::shared_ptr<node::channel_tcp> ptr;
- using options_t = network::channel_tcp::options_t;
channel_tcp(const network::logger& log, const network::socket::ptr& socket,
- : network::channel_tcp(log, socket, config.network, identifier, options),
+ uint64_t identifier, const node::configuration& config,
+ const options_t& options) NOEXCEPT
+ : network::channel_tcp(log, socket, identifier, config.network, options),
include/bitcoin/node/channels/channel_ws.hpp
@@ -35,15 +35,12 @@ class BCN_API channel_ws
typedef std::shared_ptr<node::channel_ws> ptr;
- using options_t = network::channel_ws::options_t;
- channel_ws(const network::logger& log,
- const network::socket::ptr& socket,
- : network::channel_ws(log, socket, config.network, identifier,
- options),
+ channel_ws(const network::logger& log, const network::socket::ptr& socket,
+ : network::channel_ws(log, socket, identifier, config.network, options),
47
48
49
include/bitcoin/node/chase.hpp
@@ -61,11 +61,11 @@ enum class chase
61
/// Issued by 'session_outbound' and handled by 'block_in_31800'.
62
split,
63
64
- /// Channels (all with work) directed to split work and stop (channel_t).
+ /// Channels (all with work) directed to split work and stop (peer_t).
65
66
stall,
67
68
- /// Channels (all with work) directed to drop work and stop (channel_t).
+ /// Channels (all with work) directed to drop work and stop (peer_t).
69
/// Issued by 'check' and handled by 'block_in_31800'.
70
purge,
71
include/bitcoin/node/define.hpp
@@ -70,7 +70,7 @@ using object_key = uint64_t;
/// Event value types.
using count_t = size_t;
72
using height_t = size_t;
73
-using channel_t = uint64_t;
+using peer_t = uint64_t;
74
using object_t = object_key;
75
using header_t = database::header_link::integer;
76
using transaction_t = database::tx_link::integer;
include/bitcoin/node/protocols/protocol_block_in_31800.hpp
@@ -65,8 +65,8 @@ class BCN_API protocol_block_in_31800
/// Manage work splitting.
bool is_idle() const NOEXCEPT override;
- virtual void do_purge(channel_t) NOEXCEPT;
- virtual void do_split(channel_t) NOEXCEPT;
+ virtual void do_purge(peer_t) NOEXCEPT;
+ virtual void do_split(peer_t) NOEXCEPT;
virtual void do_report(count_t count) NOEXCEPT;
/// Check incoming block message.
include/bitcoin/node/protocols/protocol_peer.hpp
@@ -35,6 +35,10 @@ class BCN_API protocol_peer
: public network::protocol_peer,
public node::protocol
+public:
+ // Replace base class channel_t (network::channel_peer).
+ using channel_t = node::channel_peer;
+
/// Constructors.
/// -----------------------------------------------------------------------
include/bitcoin/node/sessions/session_peer.hpp
@@ -21,7 +21,7 @@
21
22
#include <memory>
23
#include <utility>
24
-#include <bitcoin/node/channels/channel.hpp>
+#include <bitcoin/node/channels/channels.hpp>
25
#include <bitcoin/node/define.hpp>
26
#include <bitcoin/node/protocols/protocols.hpp>
27
#include <bitcoin/node/sessions/session.hpp>
@@ -39,6 +39,7 @@ class session_peer
typedef std::shared_ptr<session_peer<Session>> ptr;
+ using options_t = network::settings::tcp_server;
using channel_t = node::channel_peer;
/// Construct an instance.
@@ -59,9 +60,10 @@ class session_peer
59
60
BC_ASSERT(this->stranded());
+ // TODO: send options_t.
const auto channel = std::make_shared<channel_t>(
- this->get_memory(), this->log, socket, this->config(),
- this->create_key());
+ this->get_memory(), this->log, socket, this->create_key(),
+ this->config(), options_t{});
return std::static_pointer_cast<network::channel>(channel);
0 commit comments