diff --git a/contrib/epee/include/net/connection_basic.hpp b/contrib/epee/include/net/connection_basic.hpp index b415f026f..3917fc45a 100644 --- a/contrib/epee/include/net/connection_basic.hpp +++ b/contrib/epee/include/net/connection_basic.hpp @@ -100,7 +100,6 @@ class connection_basic_pimpl; // PIMPL for this class e_connection_type_P2P = 2 // to other p2p node (probably limited) }; - std::string to_string(t_connection_type type); class connection_basic { // not-templated base class for rapid development of some code parts // beware of removing const, net_utils::connection is sketchily doing a cast to prevent storing ptr twice @@ -169,8 +168,6 @@ class connection_basic { // not-templated base class for rapid development of so } // various handlers to be called from connection class: - void do_send_handler_write(const void * ptr , size_t cb); - void do_send_handler_write_from_queue(const boost::system::error_code& e, size_t cb , int q_len); // from handle_write, sending next part void logger_handle_net_write(size_t size); // network data written void logger_handle_net_read(size_t size); // network data read @@ -187,7 +184,6 @@ class connection_basic { // not-templated base class for rapid development of so static int get_tos_flag(); // handlers and sleep - void sleep_before_packet(size_t packet_size, int phase, int q_len); // execute a sleep ; phase is not really used now(?) static double get_sleep_time(size_t cb); }; diff --git a/contrib/epee/include/net/levin_base.h b/contrib/epee/include/net/levin_base.h index 404c06538..8b33b1672 100644 --- a/contrib/epee/include/net/levin_base.h +++ b/contrib/epee/include/net/levin_base.h @@ -43,20 +43,6 @@ namespace epee class byte_slice; namespace levin { -#pragma pack(push) -#pragma pack(1) - struct bucket_head - { - uint64_t m_signature; - uint64_t m_cb; - uint8_t m_have_to_return_data; - uint32_t m_command; - int32_t m_return_code; - uint32_t m_reservedA; //probably some flags in future - uint32_t m_reservedB; //probably some check sum in future - }; -#pragma pack(pop) - #pragma pack(push) #pragma pack(1) @@ -83,7 +69,6 @@ constexpr const std::chrono::milliseconds LEVIN_DEFAULT_TIMEOUT_PRECONFIGURED{0} #define LEVIN_PACKET_END 0x00000008 -#define LEVIN_PROTOCOL_VER_0 0 #define LEVIN_PROTOCOL_VER_1 1 diff --git a/contrib/epee/include/net/net_utils_base.h b/contrib/epee/include/net/net_utils_base.h index c52791344..595ad9056 100644 --- a/contrib/epee/include/net/net_utils_base.h +++ b/contrib/epee/include/net/net_utils_base.h @@ -471,18 +471,14 @@ inline MAKE_LOGGABLE(connection_context_base, ct, os) #define LOG_INFO_CC(ct, message) MINFO(ct << message) #define LOG_DEBUG_CC(ct, message) MDEBUG(ct << message) #define LOG_TRACE_CC(ct, message) MTRACE(ct << message) -#define LOG_CC(level, ct, message) MLOG(level, ct << message) #define LOG_PRINT_CC_L0(ct, message) LOG_PRINT_L0(ct << message) #define LOG_PRINT_CC_L1(ct, message) LOG_PRINT_L1(ct << message) #define LOG_PRINT_CC_L2(ct, message) LOG_PRINT_L2(ct << message) -#define LOG_PRINT_CC_L3(ct, message) LOG_PRINT_L3(ct << message) -#define LOG_PRINT_CC_L4(ct, message) LOG_PRINT_L4(ct << message) #define LOG_PRINT_CCONTEXT_L0(message) LOG_PRINT_CC_L0(context, message) #define LOG_PRINT_CCONTEXT_L1(message) LOG_PRINT_CC_L1(context, message) #define LOG_PRINT_CCONTEXT_L2(message) LOG_PRINT_CC_L2(context, message) -#define LOG_PRINT_CCONTEXT_L3(message) LOG_PRINT_CC_L3(context, message) #define LOG_ERROR_CCONTEXT(message) LOG_ERROR_CC(context, message) #define CHECK_AND_ASSERT_MES_CC(condition, return_val, err_message) CHECK_AND_ASSERT_MES(condition, return_val, "[" << epee::net_utils::print_connection_context_short(context) << "]" << err_message) diff --git a/contrib/epee/include/net/network_throttle.hpp b/contrib/epee/include/net/network_throttle.hpp index e293acf70..d9b970d12 100644 --- a/contrib/epee/include/net/network_throttle.hpp +++ b/contrib/epee/include/net/network_throttle.hpp @@ -74,7 +74,6 @@ namespace net_utils typedef double network_speed_kbps; // externally, for parameters and return values, all defined in kilobytes per second typedef double network_speed_bps; // throttle-internally, bytes per second typedef double network_time_seconds; -typedef double network_MB; class i_network_throttle; diff --git a/contrib/epee/include/profile_tools.h b/contrib/epee/include/profile_tools.h index 76f794a36..2872a429d 100644 --- a/contrib/epee/include/profile_tools.h +++ b/contrib/epee/include/profile_tools.h @@ -53,19 +53,12 @@ namespace epee #define PROFILE_FUNC_THIRD(immortal_ptr_str) #endif -#define START_WAY_POINTS() uint64_t _____way_point_time = epee::misc_utils::get_tick_count(); -#define WAY_POINT(name) {uint64_t delta = epee::misc_utils::get_tick_count()-_____way_point_time; MDEBUG("Way point " << name << ": " << delta);_____way_point_time = misc_utils::get_tick_count();} -#define WAY_POINT2(name, avrg_obj) {uint64_t delta = epee::misc_utils::get_tick_count()-_____way_point_time; avrg_obj.push(delta); MDEBUG("Way point " << name << ": " << delta);_____way_point_time = misc_utils::get_tick_count();} #define TIME_MEASURE_START(var_name) uint64_t var_name = epee::misc_utils::get_tick_count(); -#define TIME_MEASURE_PAUSE(var_name) var_name = epee::misc_utils::get_tick_count() - var_name; -#define TIME_MEASURE_RESTART(var_name) var_name = epee::misc_utils::get_tick_count() - var_name; #define TIME_MEASURE_FINISH(var_name) var_name = epee::misc_utils::get_tick_count() - var_name; #define TIME_MEASURE_NS_START(var_name) uint64_t var_name = epee::misc_utils::get_ns_count(); -#define TIME_MEASURE_NS_PAUSE(var_name) var_name = epee::misc_utils::get_ns_count() - var_name; -#define TIME_MEASURE_NS_RESTART(var_name) var_name = epee::misc_utils::get_ns_count() - var_name; #define TIME_MEASURE_NS_FINISH(var_name) var_name = epee::misc_utils::get_ns_count() - var_name; namespace profile_tools diff --git a/contrib/epee/include/storages/portable_storage_base.h b/contrib/epee/include/storages/portable_storage_base.h index c15c9b826..8d13172c8 100644 --- a/contrib/epee/include/storages/portable_storage_base.h +++ b/contrib/epee/include/storages/portable_storage_base.h @@ -160,7 +160,6 @@ namespace epee typedef boost::variant storage_entry; - typedef std::string binarybuffer;//it's ok /************************************************************************/ /* */ diff --git a/contrib/epee/include/storages/portable_storage_from_bin.h b/contrib/epee/include/storages/portable_storage_from_bin.h index fb1ab6888..1dd3c3949 100644 --- a/contrib/epee/include/storages/portable_storage_from_bin.h +++ b/contrib/epee/include/storages/portable_storage_from_bin.h @@ -83,8 +83,6 @@ namespace epee void read(section& sec); void read(std::string& str); void read(array_entry &ae); - template - size_t min_bytes() const; void set_limits(size_t objects, size_t fields, size_t strings); private: struct recursuion_limitation_guard diff --git a/contrib/epee/src/connection_basic.cpp b/contrib/epee/src/connection_basic.cpp index c1f9f8cf9..16004d510 100644 --- a/contrib/epee/src/connection_basic.cpp +++ b/contrib/epee/src/connection_basic.cpp @@ -67,21 +67,6 @@ namespace } } - std::string to_string(t_connection_type type) - { - if (type == e_connection_type_NET) - return std::string("NET"); - else if (type == e_connection_type_RPC) - return std::string("RPC"); - else if (type == e_connection_type_P2P) - return std::string("P2P"); - - return std::string("UNKNOWN"); - } - - -/* ============================================================================ */ - class connection_basic_pimpl { public: connection_basic_pimpl(const std::string &name); @@ -222,46 +207,6 @@ int connection_basic::get_tos_flag() { return connection_basic_pimpl::m_default_tos; } -void connection_basic::sleep_before_packet(size_t packet_size, int phase, int q_len) { - double delay=0; // will be calculated - do - { // rate limiting - if (m_was_shutdown) { - _dbg2("m_was_shutdown - so abort sleep"); - return; - } - - { - CRITICAL_REGION_LOCAL( network_throttle_manager::m_lock_get_global_throttle_out ); - delay = network_throttle_manager::get_global_throttle_out().get_sleep_time_after_tick( packet_size ); - } - - delay *= 0.50; - if (delay > 0) { - long int ms = (long int)(delay * 1000); - MTRACE("Sleeping in " << __FUNCTION__ << " for " << ms << " ms before packet_size="< 0); - -// XXX LATER XXX - { - CRITICAL_REGION_LOCAL( network_throttle_manager::m_lock_get_global_throttle_out ); - network_throttle_manager::get_global_throttle_out().handle_trafic_exact( packet_size ); // increase counter - global - } - -} - -void connection_basic::do_send_handler_write(const void* ptr , size_t cb ) { - // No sleeping here; sleeping is done once and for all in connection::handle_write - MTRACE("handler_write (direct) - before ASIO write, for packet="<::handle_write - MTRACE("handler_write (after write, from queue="< -struct MDB_val_copy: public MDB_val -{ - MDB_val_copy(const cryptonote::blobdata &bd) : - data(new char[bd.size()]) - { - memcpy(data.get(), bd.data(), bd.size()); - mv_size = bd.size(); - mv_data = data.get(); - } -private: - std::unique_ptr data; -}; - -template<> -struct MDB_val_copy: public MDB_val -{ - MDB_val_copy(const char *s): - size(strlen(s)+1), // include the NUL, makes it easier for compares - data(new char[size]) - { - mv_size = size; - mv_data = data.get(); - memcpy(mv_data, s, size); - } -private: - size_t size; - std::unique_ptr data; -}; - } namespace cryptonote diff --git a/src/common/command_line.h b/src/common/command_line.h index 681eb903b..9c304fbda 100644 --- a/src/common/command_line.h +++ b/src/common/command_line.h @@ -219,19 +219,6 @@ namespace command_line description.add_options()(arg.name, boost::program_options::bool_switch(), arg.description); } - template - boost::program_options::basic_parsed_options parse_command_line(int argc, const charT* const argv[], - const boost::program_options::options_description& desc, bool allow_unregistered = false) - { - auto parser = boost::program_options::command_line_parser(argc, argv); - parser.options(desc); - if (allow_unregistered) - { - parser.allow_unregistered(); - } - return parser.run(); - } - template bool handle_error_helper(const boost::program_options::options_description& desc, F parser) { diff --git a/src/common/download.cpp b/src/common/download.cpp index 859c80219..fd8e11478 100644 --- a/src/common/download.cpp +++ b/src/common/download.cpp @@ -274,20 +274,6 @@ namespace tools return control; } - bool download_finished(const download_async_handle &control) - { - CHECK_AND_ASSERT_MES(control != 0, false, "NULL async download handle"); - boost::lock_guard lock(control->mutex); - return control->stopped; - } - - bool download_error(const download_async_handle &control) - { - CHECK_AND_ASSERT_MES(control != 0, false, "NULL async download handle"); - boost::lock_guard lock(control->mutex); - return !control->success; - } - bool download_wait(const download_async_handle &control) { CHECK_AND_ASSERT_MES(control != 0, false, "NULL async download handle"); diff --git a/src/common/download.h b/src/common/download.h index 8efd29a33..97d0a3f56 100644 --- a/src/common/download.h +++ b/src/common/download.h @@ -46,8 +46,6 @@ namespace tools bool download(const std::string &path, const std::string &url, std::function progress = NULL); download_async_handle download_async(const std::string &path, const std::string &url, std::function result, std::function progress = NULL); - bool download_error(const download_async_handle &h); - bool download_finished(const download_async_handle &h); bool download_wait(const download_async_handle &h); bool download_cancel(const download_async_handle &h); } diff --git a/src/common/perf_timer.cpp b/src/common/perf_timer.cpp index fae0d7478..30d0b557d 100644 --- a/src/common/perf_timer.cpp +++ b/src/common/perf_timer.cpp @@ -97,17 +97,6 @@ el::Level performance_timer_log_level = el::Level::Info; static thread_local std::vector *performance_timers = NULL; #endif -void set_performance_timer_log_level(el::Level level) -{ - if (level != el::Level::Debug && level != el::Level::Trace && level != el::Level::Info - && level != el::Level::Warning && level != el::Level::Error && level != el::Level::Fatal) - { - MERROR("Wrong log level: " << el::LevelHelper::convertToString(level) << ", using Info"); - level = el::Level::Info; - } - performance_timer_log_level = level; -} - PerformanceTimer::PerformanceTimer(bool paused): started(true), paused(paused) { if (paused) diff --git a/src/common/perf_timer.h b/src/common/perf_timer.h index 3e53adcb8..8e9e10055 100644 --- a/src/common/perf_timer.h +++ b/src/common/perf_timer.h @@ -75,8 +75,6 @@ private: el::Level level; }; -void set_performance_timer_log_level(el::Level level); - #define PERF_TIMER_NAME(name) pt_##name #define PERF_TIMER_UNIT(name, unit) tools::LoggingPerformanceTimer PERF_TIMER_NAME(name)(#name, "perf." MONERO_DEFAULT_LOG_CATEGORY, unit, tools::performance_timer_log_level) #define PERF_TIMER_UNIT_L(name, unit, l) tools::LoggingPerformanceTimer PERF_TIMER_NAME(name)t_##name(#name, "perf." MONERO_DEFAULT_LOG_CATEGORY, unit, l)