diff --git a/include/bitcoin/node/channels/channel_peer.hpp b/include/bitcoin/node/channels/channel_peer.hpp index 516f5d33..ec738cce 100644 --- a/include/bitcoin/node/channels/channel_peer.hpp +++ b/include/bitcoin/node/channels/channel_peer.hpp @@ -36,12 +36,11 @@ class BCN_API channel_peer public: typedef std::shared_ptr ptr; - inline channel_peer(network::memory& allocator, const network::logger& log, + inline channel_peer(const network::logger& log, const network::socket::ptr& socket, uint64_t identifier, const node::configuration& config, const options_t& options) NOEXCEPT : node::channel(log, socket, identifier, config), - network::channel_peer(allocator, log, socket, identifier, - config.network, options), + network::channel_peer(log, socket, identifier, config.network, options), announced_(config.node.announcement_cache), network::tracker(log) { diff --git a/include/bitcoin/node/full_node.hpp b/include/bitcoin/node/full_node.hpp index 32396ee6..27a76558 100644 --- a/include/bitcoin/node/full_node.hpp +++ b/include/bitcoin/node/full_node.hpp @@ -19,7 +19,6 @@ #ifndef LIBBITCOIN_NODE_FULL_NODE_HPP #define LIBBITCOIN_NODE_FULL_NODE_HPP -#include #include #include #include @@ -30,19 +29,12 @@ namespace libbitcoin { namespace node { /// Thread safe. -/// WARNING: when full node is using block_memory controller, all shared block -/// components invalidate when the block destructs. Lifetime of the block is -/// assured for the extent of all methods below, however if a sub-object is -/// retained by shared_ptr, beyond method completion, a copy of the block -/// shared_ptr must also be be retained. Taking a block or sub-object copy is -/// insufficient, as copies are shallow (copy internal shared_ptr objects). class BCN_API full_node : public network::net { public: using store = node::store; using query = node::query; - using memory_controller = block_memory; using result_handler = network::result_handler; typedef std::shared_ptr ptr; @@ -160,9 +152,6 @@ class BCN_API full_node virtual void performance(object_key channel, uint64_t speed, result_handler&& handler) NOEXCEPT; - /// Get the memory resource. - virtual network::memory& get_memory() NOEXCEPT; - protected: /// Session attachments. /// ----------------------------------------------------------------------- @@ -187,7 +176,6 @@ class BCN_API full_node // These are thread safe. const configuration& config_; - memory_controller memory_; query& query_; // These are protected by strand. diff --git a/include/bitcoin/node/impl/sessions/session_peer.ipp b/include/bitcoin/node/impl/sessions/session_peer.ipp index 03c668c6..c485ab48 100644 --- a/include/bitcoin/node/impl/sessions/session_peer.ipp +++ b/include/bitcoin/node/impl/sessions/session_peer.ipp @@ -32,8 +32,8 @@ inline CLASS::channel_ptr CLASS::create_channel( BC_ASSERT(this->stranded()); const auto channel = system::emplace_shared( - this->get_memory(), this->log, socket, this->create_key(), - this->node_config(), this->options()); + this->log, socket, this->create_key(), this->node_config(), + this->options()); return std::static_pointer_cast(channel); } diff --git a/include/bitcoin/node/sessions/session.hpp b/include/bitcoin/node/sessions/session.hpp index 3a648056..2e99ced9 100644 --- a/include/bitcoin/node/sessions/session.hpp +++ b/include/bitcoin/node/sessions/session.hpp @@ -84,9 +84,6 @@ class BCN_API session virtual void performance(object_key channel, uint64_t speed, network::result_handler&& handler) NOEXCEPT; - /// Get the memory resource. - virtual network::memory& get_memory() const NOEXCEPT; - /// Suspensions. /// ----------------------------------------------------------------------- diff --git a/include/bitcoin/node/settings.hpp b/include/bitcoin/node/settings.hpp index d0ea0ae6..dd887844 100644 --- a/include/bitcoin/node/settings.hpp +++ b/include/bitcoin/node/settings.hpp @@ -45,7 +45,6 @@ class BCN_API settings float minimum_fee_rate; float minimum_bump_rate; uint16_t announcement_cache; - uint16_t allocation_multiple; uint16_t fee_estimate_horizon; ////uint64_t snapshot_bytes; ////uint32_t snapshot_valid; diff --git a/src/full_node.cpp b/src/full_node.cpp index 929c2b7b..b278bae3 100644 --- a/src/full_node.cpp +++ b/src/full_node.cpp @@ -39,7 +39,6 @@ full_node::full_node(query& query, const configuration& configuration, const logger& log) NOEXCEPT : net(configuration.network, log), config_(configuration), - memory_(config_.node.allocation_multiple, config_.network.threads), query_(query), chaser_block_(*this), chaser_header_(*this), @@ -444,11 +443,6 @@ void full_node::performance(object_key key, uint64_t speed, chaser_check_.update(key, speed, std::move(handler)); } -network::memory& full_node::get_memory() NOEXCEPT -{ - return memory_; -} - // Session attachments. // ---------------------------------------------------------------------------- diff --git a/src/sessions/session.cpp b/src/sessions/session.cpp index cd6554bc..91eb4a22 100644 --- a/src/sessions/session.cpp +++ b/src/sessions/session.cpp @@ -109,11 +109,6 @@ void session::performance(object_key key, uint64_t speed, node_.performance(key, speed, std::move(handler)); } -network::memory& session::get_memory() const NOEXCEPT -{ - return node_.get_memory(); -} - // Suspensions. // ---------------------------------------------------------------------------- diff --git a/src/settings.cpp b/src/settings.cpp index 8f9b231b..2066d5d5 100644 --- a/src/settings.cpp +++ b/src/settings.cpp @@ -41,7 +41,6 @@ settings::settings() NOEXCEPT minimum_bump_rate{ 0.0 }, allowed_deviation{ 1.5 }, announcement_cache{ 42 }, - allocation_multiple{ 20 }, fee_estimate_horizon{ 0 }, ////snapshot_bytes{ 200'000'000'000 }, ////snapshot_valid{ 250'000 }, diff --git a/test/settings.cpp b/test/settings.cpp index e1920b63..57b44143 100644 --- a/test/settings.cpp +++ b/test/settings.cpp @@ -41,7 +41,6 @@ BOOST_AUTO_TEST_CASE(settings__node__default_context__expected) BOOST_REQUIRE_EQUAL(node.minimum_bump_rate, 0.0); BOOST_REQUIRE_EQUAL(node.allowed_deviation, 1.5); BOOST_REQUIRE_EQUAL(node.announcement_cache, 42_u16); - BOOST_REQUIRE_EQUAL(node.allocation_multiple, 20_u16); BOOST_REQUIRE_EQUAL(node.fee_estimate_horizon, 0u); ////BOOST_REQUIRE_EQUAL(node.snapshot_bytes, 200'000'000'000_u64); ////BOOST_REQUIRE_EQUAL(node.snapshot_valid, 250'000_u32); diff --git a/test/test.hpp b/test/test.hpp index bdc027cc..8c4eeee6 100644 --- a/test/test.hpp +++ b/test/test.hpp @@ -63,18 +63,6 @@ std::ostream& operator<<(std::ostream& stream, return stream; } -// std_vector -> join(< -std::ostream& operator<<(std::ostream& stream, - const std_vector& values) NOEXCEPT -{ - // Ok when testing serialize because only used for error message out. - BC_PUSH_WARNING(NO_THROW_IN_NOEXCEPT) - stream << system::serialize(values); - BC_POP_WARNING() - return stream; -} - // array -> join(< std::ostream& operator<<(std::ostream& stream,