diff --git a/builds/msvc/resource.rc b/builds/msvc/resource.rc index ac1f75c1..dd9d09d1 100644 Binary files a/builds/msvc/resource.rc and b/builds/msvc/resource.rc differ diff --git a/configure.ac b/configure.ac index d4d8bd78..a3b23e2f 100644 --- a/configure.ac +++ b/configure.ac @@ -13,7 +13,7 @@ AC_PREREQ([2.65]) # Process command-line arguments and perform initialization and verification. -AC_INIT([libbitcoin-server], [3.1.0], [eric@voskuil.org]) +AC_INIT([libbitcoin-server], [3.2.0], [eric@voskuil.org]) # Do compilation tests. AC_LANG(C++) @@ -157,10 +157,10 @@ AS_CASE([${bash_completiondir}], [yes], AC_MSG_NOTICE([bash_completion_LIBS : ${bash_completion_LIBS}])], [AC_SUBST([bash_completion_PKG], [])]) -# Require bitcoin-node of at least version 3.1.0 and output ${bitcoin_node_CPPFLAGS/LIBS/PKG}. +# Require bitcoin-node of at least version 3.2.0 and output ${bitcoin_node_CPPFLAGS/LIBS/PKG}. #------------------------------------------------------------------------------ -PKG_CHECK_MODULES([bitcoin_node], [libbitcoin-node >= 3.1.0]) -AC_SUBST([bitcoin_node_PKG], ['libbitcoin-node >= 3.1.0']) +PKG_CHECK_MODULES([bitcoin_node], [libbitcoin-node >= 3.2.0]) +AC_SUBST([bitcoin_node_PKG], ['libbitcoin-node >= 3.2.0']) AC_SUBST([bitcoin_node_CPPFLAGS], [${bitcoin_node_CFLAGS}]) AC_MSG_NOTICE([bitcoin_node_CPPFLAGS : ${bitcoin_node_CPPFLAGS}]) AC_MSG_NOTICE([bitcoin_node_LIBS : ${bitcoin_node_LIBS}]) diff --git a/console/executor.cpp b/console/executor.cpp index 7a3e15d9..f8dbd3d7 100644 --- a/console/executor.cpp +++ b/console/executor.cpp @@ -54,6 +54,7 @@ executor::executor(parser& metadata, std::istream& input, : metadata_(metadata), output_(output), error_(error) { const auto& network = metadata_.configured.network; + const auto verbose = network.verbose; const log::rotable_file debug_file { @@ -78,7 +79,7 @@ executor::executor(parser& metadata, std::istream& input, log::stream console_out(&output_, null_deleter()); log::stream console_err(&error_, null_deleter()); - log::initialize(debug_file, error_file, console_out, console_err); + log::initialize(debug_file, error_file, console_out, console_err, verbose); handle_stop(initialize_stop); } diff --git a/data/bs.cfg b/data/bs.cfg index cae34bac..7754569c 100644 --- a/data/bs.cfg +++ b/data/bs.cfg @@ -107,8 +107,6 @@ priority = true use_libconsensus = false # The maximum reorganization depth, defaults to 256 (0 for unlimited). reorganization_limit = 256 -# The block version for block creation and transaction pool validation, defaults to 4. -block_version = 4 # A hash:height checkpoint, multiple entries allowed, defaults shown. checkpoint = 000000000019d6689c085ae165831e934ff763ae46a2a6c172b3f1b60a8ce26f:0 checkpoint = 0000000069e244f73d78e8fd29ba2fd2ed618bd6fa2ee92559f542fdb26e7c1d:11111 @@ -154,12 +152,18 @@ bip65 = true bip90 = true [node] -# The time period for block polling after initial block download, defaults to 1 (0 disables). -block_poll_seconds = 1 -# The minimum fee per byte required for transaction acceptance, defaults to 1. -minimum_byte_fee_satoshis = 1 -# Request that peers relay transactions, defaults to false. -relay_transactions = false +# The time to wait for a requested block, defaults to 60. +block_latency_seconds = 60 +# Disable relay when top block age exceeds, defaults to 24 (0 disables). +notify_limit_hours = 24 +# The minimum fee per byte, cumulative for conflicts, defaults to 1. +byte_fee_satoshis = 1 +# The minimum fee per sigop, additional to byte fee, defaults to 100. +sigop_fee_satoshis = 100 +# The minimum output value, defaults to 500. +minimum_output_satoshis = 500 +# Request that peers relay transactions, defaults to true. +relay_transactions = true # Request transactions on each channel start, defaults to true. refresh_transactions = true @@ -176,16 +180,16 @@ handshake_seconds = 30 secure_only = false # The number of query worker threads per endpoint, defaults to 1 (0 disables service). query_workers = 1 -# The maximum number of query subscriptions, defaults to 0 (subscription disabled). -subscription_limit = 0 -# The query subscription expiration time, defaults to 10. +# The maximum number of query subscriptions, defaults to 1000 (0 disables subscribe). +subscription_limit = 1000 +# The query subscription expiration time, defaults to 10 (0 disables expiration). subscription_expiration_minutes = 10 -# The heartbeat service interval, defaults to 0 (service disabled). -heartbeat_service_seconds = 0 -# Enable the block publishing service, defaults to false. -block_service_enabled = false -# Enable the transaction publishing service, defaults to false. -transaction_service_enabled = false +# The heartbeat service interval, defaults to 5 (0 disables service). +heartbeat_service_seconds = 5 +# Enable the block publishing service, defaults to true. +block_service_enabled = true +# Enable the transaction publishing service, defaults to true. +transaction_service_enabled = true # The secure query endpoint, defaults to 'tcp://*:9081'. secure_query_endpoint = tcp://*:9081 diff --git a/include/bitcoin/server/interface/blockchain.hpp b/include/bitcoin/server/interface/blockchain.hpp index 15dde8c2..855cb40a 100644 --- a/include/bitcoin/server/interface/blockchain.hpp +++ b/include/bitcoin/server/interface/blockchain.hpp @@ -88,7 +88,7 @@ class BCS_API blockchain const chain::history_compact::list& history, const message& request, send_handler handler); - static void transaction_fetched(const code& ec, transaction_ptr tx, size_t, + static void transaction_fetched(const code& ec, transaction_const_ptr tx, size_t, size_t, const message& request, send_handler handler); static void last_height_fetched(const code& ec, size_t last_height, @@ -128,7 +128,7 @@ class BCS_API blockchain const chain::stealth_compact::list& stealth_results, const message& request, send_handler handler); - static void stealth_transaction_fetched(const code& ec, + static void stealth_transaction_hashes_fetched(const code& ec, const chain::stealth_compact::list& stealth_results, const message& request, send_handler handler); diff --git a/include/bitcoin/server/interface/transaction_pool.hpp b/include/bitcoin/server/interface/transaction_pool.hpp index b7d4dcf6..17a4682a 100644 --- a/include/bitcoin/server/interface/transaction_pool.hpp +++ b/include/bitcoin/server/interface/transaction_pool.hpp @@ -45,7 +45,7 @@ class BCS_API transaction_pool send_handler handler); private: - static void transaction_fetched(const code& ec, transaction_ptr tx, + static void transaction_fetched(const code& ec, transaction_const_ptr tx, size_t, size_t, const message& request, send_handler handler); static void handle_broadcast(const code& ec, const message& request, diff --git a/include/bitcoin/server/services/block_service.hpp b/include/bitcoin/server/services/block_service.hpp index e5155630..6ff313be 100644 --- a/include/bitcoin/server/services/block_service.hpp +++ b/include/bitcoin/server/services/block_service.hpp @@ -58,8 +58,8 @@ class BCS_API block_service private: bool handle_reorganization(const code& ec, size_t fork_height, - block_const_ptr_list_const_ptr new_blocks, - block_const_ptr_list_const_ptr old_blocks); + block_const_ptr_list_const_ptr incoming, + block_const_ptr_list_const_ptr outgoing); void publish_blocks(uint32_t fork_height, block_const_ptr_list_const_ptr blocks); @@ -68,7 +68,6 @@ class BCS_API block_service // These are thread safe. const bool secure_; - const bool verbose_; const std::string security_; const bc::server::settings& settings_; const bc::protocol::settings& external_; diff --git a/include/bitcoin/server/services/heartbeat_service.hpp b/include/bitcoin/server/services/heartbeat_service.hpp index 7a63f562..9549722b 100644 --- a/include/bitcoin/server/services/heartbeat_service.hpp +++ b/include/bitcoin/server/services/heartbeat_service.hpp @@ -60,7 +60,6 @@ class BCS_API heartbeat_service // These are thread safe. const bool secure_; - const bool verbose_; const std::string security_; const bc::server::settings& settings_; const bc::protocol::settings& external_; diff --git a/include/bitcoin/server/services/transaction_service.hpp b/include/bitcoin/server/services/transaction_service.hpp index 5dd3945d..93fd685e 100644 --- a/include/bitcoin/server/services/transaction_service.hpp +++ b/include/bitcoin/server/services/transaction_service.hpp @@ -61,7 +61,6 @@ class BCS_API transaction_service // These are thread safe. const bool secure_; - const bool verbose_; const std::string security_; const bc::server::settings& settings_; const bc::protocol::settings& external_; diff --git a/include/bitcoin/server/version.hpp b/include/bitcoin/server/version.hpp index 520fa474..79de5d28 100644 --- a/include/bitcoin/server/version.hpp +++ b/include/bitcoin/server/version.hpp @@ -12,9 +12,9 @@ * For interpretation of the versioning scheme see: http://semver.org */ -#define LIBBITCOIN_SERVER_VERSION "3.1.0" +#define LIBBITCOIN_SERVER_VERSION "3.2.0" #define LIBBITCOIN_SERVER_MAJOR_VERSION 3 -#define LIBBITCOIN_SERVER_MINOR_VERSION 1 +#define LIBBITCOIN_SERVER_MINOR_VERSION 2 #define LIBBITCOIN_SERVER_PATCH_VERSION 0 #endif diff --git a/include/bitcoin/server/workers/notification_worker.hpp b/include/bitcoin/server/workers/notification_worker.hpp index 6b68f1e3..1269a119 100644 --- a/include/bitcoin/server/workers/notification_worker.hpp +++ b/include/bitcoin/server/workers/notification_worker.hpp @@ -106,8 +106,8 @@ class BCS_API notification_worker bool stealth_subscriptions_empty() const; bool handle_reorganization(const code& ec, size_t fork_height, - block_const_ptr_list_const_ptr new_blocks, - block_const_ptr_list_const_ptr old_blocks); + block_const_ptr_list_const_ptr incoming, + block_const_ptr_list_const_ptr outgoing); bool handle_transaction_pool(const code& ec, transaction_const_ptr tx); void notify_block(socket& dealer, size_t height, block_const_ptr block); diff --git a/include/bitcoin/server/workers/query_worker.hpp b/include/bitcoin/server/workers/query_worker.hpp index 72efaf00..f86a8b13 100644 --- a/include/bitcoin/server/workers/query_worker.hpp +++ b/include/bitcoin/server/workers/query_worker.hpp @@ -67,7 +67,6 @@ class BCS_API query_worker // These are thread safe. const bool secure_; - const bool verbose_; const std::string security_; const bc::server::settings& settings_; const bc::protocol::settings& external_; diff --git a/libbitcoin-server.pc.in b/libbitcoin-server.pc.in index 6a4964d6..c0ca0b3b 100644 --- a/libbitcoin-server.pc.in +++ b/libbitcoin-server.pc.in @@ -25,7 +25,7 @@ Version: @PACKAGE_VERSION@ #============================================================================== # Dependencies that publish package configuration. #------------------------------------------------------------------------------ -Requires: libbitcoin-protocol >= 3.1.0 libbitcoin-node >= 3.1.0 +Requires: libbitcoin-protocol >= 3.1.0 libbitcoin-node >= 3.2.0 # Include directory and any other required compiler flags. #------------------------------------------------------------------------------ diff --git a/src/interface/blockchain.cpp b/src/interface/blockchain.cpp index 1a96d22a..7e5a8851 100644 --- a/src/interface/blockchain.cpp +++ b/src/interface/blockchain.cpp @@ -109,7 +109,7 @@ void blockchain::fetch_transaction(server_node& node, const message& request, _1, _2, _3, _4, request, handler)); } -void blockchain::transaction_fetched(const code& ec, transaction_ptr tx, +void blockchain::transaction_fetched(const code& ec, transaction_const_ptr tx, size_t, size_t, const message& request, send_handler handler) { if (ec) @@ -485,11 +485,11 @@ void blockchain::fetch_stealth_transaction_hashes(server_node& node, const size_t from_height = deserial.read_4_bytes_little_endian(); node.chain().fetch_stealth(binary{ bits, blocks }, from_height, - std::bind(&blockchain::stealth_transaction_fetched, + std::bind(&blockchain::stealth_transaction_hashes_fetched, _1, _2, request, handler)); } -void blockchain::stealth_transaction_fetched(const code& ec, +void blockchain::stealth_transaction_hashes_fetched(const code& ec, const stealth_compact::list& stealth_results, const message& request, send_handler handler) { diff --git a/src/interface/transaction_pool.cpp b/src/interface/transaction_pool.cpp index 5e861b93..27b983b7 100644 --- a/src/interface/transaction_pool.cpp +++ b/src/interface/transaction_pool.cpp @@ -53,8 +53,9 @@ void transaction_pool::fetch_transaction(server_node& node, _1, _2, _3, _4, request, handler)); } -void transaction_pool::transaction_fetched(const code& ec, transaction_ptr tx, - size_t, size_t, const message& request, send_handler handler) +void transaction_pool::transaction_fetched(const code& ec, + transaction_const_ptr tx, size_t, size_t, const message& request, + send_handler handler) { if (ec) { diff --git a/src/parser.cpp b/src/parser.cpp index bd9a22c7..fa1c2b89 100644 --- a/src/parser.cpp +++ b/src/parser.cpp @@ -356,11 +356,6 @@ options_metadata parser::load_settings() value(&configured.chain.reorganization_limit), "The maximum reorganization depth, defaults to 256 (0 for unlimited)." ) - ( - "blockchain.block_version", - value(&configured.chain.block_version), - "The block version for block creation and transaction pool validation, defaults to 4." - ) ( "blockchain.checkpoint", value(&configured.chain.checkpoints), @@ -371,7 +366,7 @@ options_metadata parser::load_settings() ( "fork.easy_blocks", value(&configured.chain.easy_blocks), - "Allow minimum difficulty blocks, defaults to false (use true for testnet)." + "Allow minimum difficulty blocks, defaults to false." ) ( "fork.bip16", @@ -416,22 +411,34 @@ options_metadata parser::load_settings() //// "The time limit for block response during initial block download, defaults to 5." ////) ( - "node.block_poll_seconds", - value(&configured.node.block_poll_seconds), - "The time period for block polling after initial block download, defaults to 1 (0 disables)." + "node.block_latency_seconds", + value(&configured.node.block_latency_seconds), + "The time to wait for a requested block, defaults to 60." ) ( /* Internally this is blockchain, but it is conceptually a node setting. */ - "node.minimum_byte_fee_satoshis", - value(&configured.chain.minimum_byte_fee_satoshis), - "The minimum fee per byte required for transaction acceptance, defaults to 1." + "node.notify_limit_hours", + value(&configured.chain.notify_limit_hours), + "Disable relay when top block age exceeds, defaults to 24 (0 disables)." + ) + ( + /* Internally this is blockchain, but it is conceptually a node setting. */ + "node.byte_fee_satoshis", + value(&configured.chain.byte_fee_satoshis), + "The minimum fee per byte, cumulative for conflicts, defaults to 1." + ) + ( + /* Internally this is blockchain, but it is conceptually a node setting. */ + "node.sigop_fee_satoshis", + value(&configured.chain.sigop_fee_satoshis), + "The minimum fee per sigop, additional to byte fee, defaults to 100." + ) + ( + /* Internally this is blockchain, but it is conceptually a node setting. */ + "node.minimum_output_satoshis", + value(&configured.chain.minimum_output_satoshis), + "The minimum output value, defaults to 500." ) - ////( - //// /* Internally this is blockchain, but it is conceptually a node setting. */ - //// "node.reject_conflicts", - //// value(&configured.chain.reject_conflicts), - //// "Retain only the first seen of conflicting transactions, defaults to true." - ////) ( /* Internally this is network, but it is conceptually a node setting. */ "node.relay_transactions", @@ -482,17 +489,17 @@ options_metadata parser::load_settings() ( "server.subscription_limit", value(&configured.server.subscription_limit), - "The maximum number of query subscriptions, defaults to 0 (subscription disabled)." + "The maximum number of query subscriptions, defaults to 1000 (0 disables subscribe)." ) ( "server.subscription_expiration_minutes", value(&configured.server.subscription_expiration_minutes), - "The subscription expiration time, defaults to 10." + "The query subscription expiration time, defaults to 10 (0 disables expiration)." ) ( "server.heartbeat_service_seconds", value(&configured.server.heartbeat_service_seconds), - "The heartbeat service interval, defaults to 0 (service disabled)." + "The heartbeat service interval, defaults to 5 (0 disables service)." ) ( "server.block_service_enabled", diff --git a/src/services/block_service.cpp b/src/services/block_service.cpp index 820d13b3..a53e55ac 100644 --- a/src/services/block_service.cpp +++ b/src/services/block_service.cpp @@ -43,7 +43,6 @@ block_service::block_service(zmq::authenticator& authenticator, server_node& node, bool secure) : worker(priority(node.server_settings().priority)), secure_(secure), - verbose_(node.network_settings().verbose), security_(secure ? "secure" : "public"), settings_(node.server_settings()), external_(node.protocol_settings()), @@ -144,7 +143,7 @@ bool block_service::unbind(zmq::socket& xpub, zmq::socket& xsub) // ---------------------------------------------------------------------------- bool block_service::handle_reorganization(const code& ec, size_t fork_height, - block_const_ptr_list_const_ptr new_blocks, block_const_ptr_list_const_ptr) + block_const_ptr_list_const_ptr incoming, block_const_ptr_list_const_ptr) { if (stopped() || ec == error::service_stopped) return false; @@ -158,12 +157,16 @@ bool block_service::handle_reorganization(const code& ec, size_t fork_height, return true; } - // Nothing to do here. - if (!new_blocks || new_blocks->empty()) + // Nothing to do here, a channel is stopping. + if (!incoming || incoming->empty()) + return true; + + // Do not announce blocks to clients if too far behind. + if (node_.chain().is_stale()) return true; // Blockchain height is 64 bit but obelisk protocol is 32 bit. - publish_blocks(safe_unsigned(fork_height), new_blocks); + publish_blocks(safe_unsigned(fork_height), incoming); return true; } @@ -226,10 +229,9 @@ void block_service::publish_block(zmq::socket& publisher, size_t height, } // This isn't actually a request, should probably update settings. - if (verbose_) - LOG_DEBUG(LOG_SERVER) - << "Published " << security_ << " block [" - << encode_hash(block->hash()) << "] (" << sequence_ << ")."; + LOG_VERBOSE(LOG_SERVER) + << "Published " << security_ << " block [" + << encode_hash(block->hash()) << "] (" << sequence_ << ")."; } } // namespace server diff --git a/src/services/heartbeat_service.cpp b/src/services/heartbeat_service.cpp index 7fe43b8d..83f20e7c 100644 --- a/src/services/heartbeat_service.cpp +++ b/src/services/heartbeat_service.cpp @@ -38,7 +38,6 @@ heartbeat_service::heartbeat_service(zmq::authenticator& authenticator, server_node& node, bool secure) : worker(priority(node.server_settings().priority)), secure_(secure), - verbose_(node.network_settings().verbose), security_(secure ? "secure" : "public"), settings_(node.server_settings()), external_(node.protocol_settings()), @@ -148,8 +147,7 @@ void heartbeat_service::publish(zmq::socket& publisher) } // This isn't actually a request, should probably update settings. - if (verbose_) - LOG_DEBUG(LOG_SERVER) + LOG_VERBOSE(LOG_SERVER) << "Published " << security_ << " heartbeat [" << sequence_ << "]."; } diff --git a/src/services/transaction_service.cpp b/src/services/transaction_service.cpp index c2a2e003..7fd3e685 100644 --- a/src/services/transaction_service.cpp +++ b/src/services/transaction_service.cpp @@ -42,7 +42,6 @@ transaction_service::transaction_service(zmq::authenticator& authenticator, server_node& node, bool secure) : worker(priority(node.server_settings().priority)), secure_(secure), - verbose_(node.network_settings().verbose), security_(secure ? "secure" : "public"), settings_(node.server_settings()), external_(node.protocol_settings()), @@ -157,10 +156,14 @@ bool transaction_service::handle_transaction(const code& ec, return true; } - // Nothing to do here. + // Nothing to do here, a channel is stopping. if (!tx) return true; + // Do not announce txs to clients if too far behind. + if (node_.chain().is_stale()) + return true; + publish_transaction(tx); return true; } @@ -211,10 +214,9 @@ void transaction_service::publish_transaction(transaction_const_ptr tx) } // This isn't actually a request, should probably update settings. - if (verbose_) - LOG_DEBUG(LOG_SERVER) - << "Published " << security_ << " transaction [" - << encode_hash(tx->hash()) << "] (" << sequence_ << ")."; + LOG_VERBOSE(LOG_SERVER) + << "Published " << security_ << " transaction [" + << encode_hash(tx->hash()) << "] (" << sequence_ << ")."; } } // namespace server diff --git a/src/settings.cpp b/src/settings.cpp index 7f415d52..3f440051 100644 --- a/src/settings.cpp +++ b/src/settings.cpp @@ -26,14 +26,14 @@ namespace server { using namespace asio; settings::settings() - : query_workers(1), - heartbeat_service_seconds(0), - subscription_limit(0), - subscription_expiration_minutes(10), - priority(false), + : priority(false), secure_only(false), - block_service_enabled(false), - transaction_service_enabled(false), + query_workers(1), + subscription_limit(1000), + subscription_expiration_minutes(10), + heartbeat_service_seconds(5), + block_service_enabled(true), + transaction_service_enabled(true), secure_query_endpoint("tcp://*:9081"), secure_heartbeat_endpoint("tcp://*:9082"), diff --git a/src/workers/notification_worker.cpp b/src/workers/notification_worker.cpp index 8522937b..acdf5ba8 100644 --- a/src/workers/notification_worker.cpp +++ b/src/workers/notification_worker.cpp @@ -161,7 +161,7 @@ bool notification_worker::send(zmq::socket& dealer, // ---------------------------------------------------------------------------- bool notification_worker::handle_reorganization(const code& ec, - size_t fork_height, block_const_ptr_list_const_ptr new_blocks, + size_t fork_height, block_const_ptr_list_const_ptr incoming, block_const_ptr_list_const_ptr) { if (stopped() || ec == error::service_stopped) @@ -176,8 +176,12 @@ bool notification_worker::handle_reorganization(const code& ec, return true; } - // Nothing to do here. - if (!new_blocks || new_blocks->empty()) + // Nothing to do here, a channel is stopping. + if (!incoming || incoming->empty()) + return true; + + // Do not announce addresses to clients if too far behind. + if (node_.chain().is_stale()) return true; if (address_subscriptions_empty() && stealth_subscriptions_empty()) @@ -189,8 +193,8 @@ bool notification_worker::handle_reorganization(const code& ec, if (!dealer) return true; - for (const auto block: *new_blocks) - notify_block(*dealer, safe_increment(fork_height), block); + for (const auto block: *incoming) + notify_block(*dealer, safe_add(fork_height, size_t(1)), block); return true; } @@ -227,6 +231,10 @@ bool notification_worker::handle_transaction_pool(const code& ec, if (!tx) return true; + // Do not announce addresses to clients if too far behind. + if (node_.chain().is_stale()) + return true; + if (address_subscriptions_empty() && stealth_subscriptions_empty()) return true; @@ -262,14 +270,19 @@ void notification_worker::notify_transaction(zmq::socket& dealer, { for (const auto& input: tx.inputs()) { + // TODO: use a vector result to extract sign_multisig. const auto address = input.address(); + if (address) addresses.insert(address.hash()); } for (const auto& output: outputs) { + // TODO: use a vector result to extract pay_multisig. + // TODO: notify all multisig participants using prevout addresses. const auto address = output.address(); + if (address) addresses.insert(address.hash()); } @@ -383,6 +396,10 @@ time_t notification_worker::current_time() time_t notification_worker::cutoff_time() const { + // In case a purge call is made, nothing will be puged (until rollover). + if (settings_.subscription_expiration_minutes == 0) + return max_int32; + // use system_clock to ensure to_time_t is defined. const auto now = system_clock::now(); const auto period = minutes(settings_.subscription_expiration_minutes); @@ -391,6 +408,10 @@ time_t notification_worker::cutoff_time() const int32_t notification_worker::purge_milliseconds() const { + // This results in infinite polling and therefore no purge calls. + if (settings_.subscription_expiration_minutes == 0) + return -1; + const int64_t minutes = settings_.subscription_expiration_minutes; const int64_t milliseconds = minutes * 60 * 1000; auto capped = std::min(milliseconds, static_cast(max_int32)); diff --git a/src/workers/query_worker.cpp b/src/workers/query_worker.cpp index 3bd076f5..38b68a09 100644 --- a/src/workers/query_worker.cpp +++ b/src/workers/query_worker.cpp @@ -40,7 +40,6 @@ query_worker::query_worker(zmq::authenticator& authenticator, server_node& node, bool secure) : worker(priority(node.server_settings().priority)), secure_(secure), - verbose_(node.network_settings().verbose), security_(secure ? "secure" : "public"), settings_(node.server_settings()), external_(node.protocol_settings()), @@ -163,10 +162,9 @@ void query_worker::query(zmq::socket& dealer) return; } - if (verbose_) - LOG_INFO(LOG_SERVER) - << "Query " << request.command() << " from " - << request.route().display(); + LOG_VERBOSE(LOG_SERVER) + << "Query " << request.command() << " from " + << request.route().display(); // The query executor is the delegate bound by the attach method. const auto& query_execute = handler->second;