From 06d0c0d000175312f444588c4424b6471f3e6028 Mon Sep 17 00:00:00 2001 From: cryptocode <34946442+cryptocode@users.noreply.github.com> Date: Mon, 23 Apr 2018 14:14:32 +0200 Subject: [PATCH] Remove unused function and captures (#822) --- rai/node/bootstrap.cpp | 4 ++-- rai/node/node.cpp | 16 ---------------- rai/node/node.hpp | 1 - 3 files changed, 2 insertions(+), 19 deletions(-) diff --git a/rai/node/bootstrap.cpp b/rai/node/bootstrap.cpp index 37d54b30..83f6151e 100644 --- a/rai/node/bootstrap.cpp +++ b/rai/node/bootstrap.cpp @@ -911,7 +911,7 @@ void rai::bootstrap_attempt::request_pull (std::unique_lock & lock_a auto size (pulls.size ()); // The bulk_pull_client destructor attempt to requeue_pull which can cause a deadlock if this is the last reference // Dispatch request in an external thread in case it needs to be destroyed - node->background ([connection_l, pull, size]() { + node->background ([connection_l, pull]() { auto client (std::make_shared (connection_l, pull)); client->request (); }); @@ -1264,7 +1264,7 @@ void rai::bootstrap_attempt::requeue_pull (rai::pull_info const & pull_a) if (auto connection_shared = connection_frontier_request.lock ()) { auto size (pulls.size ()); - node->background ([connection_shared, pull, size]() { + node->background ([connection_shared, pull]() { auto client (std::make_shared (connection_shared, pull)); client->request (); }); diff --git a/rai/node/node.cpp b/rai/node/node.cpp index fc94a0e2..45d02058 100644 --- a/rai/node/node.cpp +++ b/rai/node/node.cpp @@ -139,22 +139,6 @@ void rai::network::republish (rai::block_hash const & hash_a, std::shared_ptr block_a) -{ - auto hash (block_a->hash ()); - rai::publish message (block_a); - std::shared_ptr> bytes (new std::vector); - { - rai::vectorstream stream (*bytes); - message.serialize (stream); - } - auto representatives (node.peers.representatives (2 * node.peers.size_sqrt ())); - for (auto i : representatives) - { - republish (hash, bytes, i.endpoint); - } -} - template bool confirm_block (MDB_txn * transaction_a, rai::node & node_a, T & list_a, std::shared_ptr block_a) { diff --git a/rai/node/node.hpp b/rai/node/node.hpp index 6ff87bca..d459b1f5 100644 --- a/rai/node/node.hpp +++ b/rai/node/node.hpp @@ -345,7 +345,6 @@ public: void stop (); void receive_action (boost::system::error_code const &, size_t); void rpc_action (boost::system::error_code const &, size_t); - void rebroadcast_reps (std::shared_ptr); void republish_vote (std::shared_ptr); void republish_block (MDB_txn *, std::shared_ptr); void republish (rai::block_hash const &, std::shared_ptr>, rai::endpoint);