From 1c87b0ccb431843d2184661a42e9400230cb8c59 Mon Sep 17 00:00:00 2001 From: evoskuil Date: Sun, 28 Jul 2024 12:46:15 -0400 Subject: [PATCH 1/2] Remove obsoleted block message cached_size reference. --- src/protocols/protocol_block_in_31800.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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()) { From 26757445d4b29a648bc088a6d7e24e6ee4f7ec07 Mon Sep 17 00:00:00 2001 From: evoskuil Date: Sun, 28 Jul 2024 14:22:13 -0400 Subject: [PATCH 2/2] Stub in custom channel creator with default allocator. --- include/bitcoin/node/sessions/attach.hpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) 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