diff --git a/include/bitcoin/node/sessions/attach.hpp b/include/bitcoin/node/sessions/attach.hpp index c6695bdf..c2761271 100644 --- a/include/bitcoin/node/sessions/attach.hpp +++ b/include/bitcoin/node/sessions/attach.hpp @@ -102,6 +102,18 @@ class attach channel->attach(self)->start(); channel->attach(self)->start(); } + + network::channel::ptr create_channel(const network::socket::ptr& socket, + bool quiet) NOEXCEPT override + { + // TODO: replace message memory resource (affects only block messages). + static network::memory memory{}; + + // Channel id must be created using create_key(). + const auto id = network::session::create_key(); + return std::make_shared(memory, network::session::log, + socket, network::session::settings(), id, quiet); + } }; } // namespace node diff --git a/src/protocols/protocol_block_in_31800.cpp b/src/protocols/protocol_block_in_31800.cpp index bd68b95c..5e3a43e1 100644 --- a/src/protocols/protocol_block_in_31800.cpp +++ b/src/protocols/protocol_block_in_31800.cpp @@ -375,7 +375,7 @@ bool protocol_block_in_31800::handle_receive_block(const code& ec, notify(ec, chase::checked, height); fire(events::block_archived, height); - count(message->cached_size); + count(size); map_->erase(it); if (is_idle()) {