diff --git a/include/kth/node/executor/executor.hpp b/include/kth/node/executor/executor.hpp index 9d54f63..1c4a4ef 100644 --- a/include/kth/node/executor/executor.hpp +++ b/include/kth/node/executor/executor.hpp @@ -58,6 +58,7 @@ class executor { private: bool wait_for_signal_and_close(); + void print_ascii_art(); static void stop(kth::code const& ec); @@ -73,6 +74,7 @@ class executor { static std::promise stopping_; + bool stdout_enabled_; kth::node::configuration config_; kth::node::full_node::ptr node_; kth::handle0 run_handler_; diff --git a/src/executor/executor.cpp b/src/executor/executor.cpp index 11e61c2..8fea9c0 100644 --- a/src/executor/executor.cpp +++ b/src/executor/executor.cpp @@ -55,7 +55,8 @@ static auto const mode = std::ofstream::out | std::ofstream::app; std::promise executor::stopping_; //NOLINT executor::executor(kth::node::configuration const& config, bool stdout_enabled /*= true*/) - : config_(config) + : stdout_enabled_(stdout_enabled) + , config_(config) { #if ! defined(__EMSCRIPTEN__) auto& network = config_.network; @@ -367,10 +368,36 @@ void executor::stop(kth::code const& ec) { // Utilities. // ---------------------------------------------------------------------------- +void executor::print_ascii_art() { + std::cout << " ...\n"; + std::cout << " .-=*#%%= :-=+++*#:\n"; + std::cout << " :+*%%%@= .:--#@@#.\n"; + std::cout << " :%%@= .:. :%@#.\n"; + std::cout << " .%%@= .*%%- :#@%:\n"; + std::cout << " :%%@= .. .#@%= .#@%-\n"; + std::cout << " :%%@= .=###**+. -+++#%%%***. +@%= :=+*+-\n"; + std::cout << " :%%%- :%%=:. :--%@%*-::. =%%= -+*=-%@@=\n"; + std::cout << " :%%%: :*+. .::. =%@*. :%@#:++: +@@+\n"; + std::cout << " :%%%*+#: .#%%%= -%@#. .*%%%*: *%@-\n"; + std::cout << " -%%%@@%*- :#@@%= :#@#. +@%%+ :%%%.\n"; + std::cout << " =@%%-+%@%+. .-=- .#@%:.=*. -%%%- .#@%-\n"; + std::cout << " -@%%. :*%@#- .*@%+=#%- :%@#: .-- .*@%-\n"; + std::cout << " .:*@%%: =%@@*-. +@%%@%+. .*@#. *@@*=#@#:\n"; + std::cout << " .*#####*: -*#####*. *%%*=. .**: :*#%#+-.\n"; + std::cout << " ........ .. .... ... ..\n"; + std::cout << "\n"; + std::cout << " High Performance Bitcoin Cash Node\n"; + std::cout << "\n"; +} + // Set up logging. void executor::initialize_output(std::string_view extra, db_mode_type db_mode) { auto const& file = config_.file; + if (stdout_enabled_) { + print_ascii_art(); + } + if (file.empty()) { LOG_INFO(LOG_NODE, KTH_USING_DEFAULT_CONFIG); } else { diff --git a/src/protocols/protocol_block_in.cpp b/src/protocols/protocol_block_in.cpp index 43fa9fa..d438166 100644 --- a/src/protocols/protocol_block_in.cpp +++ b/src/protocols/protocol_block_in.cpp @@ -817,9 +817,9 @@ void protocol_block_in::report(domain::chain::block const& block) { block.validation.cache_efficiency); #endif - auto formatted = fmt::format("Block [{:6}] {:>5} txs {:>5} ins " + auto formatted = fmt::format("[{:6}] {:>5} txs {:>5} ins " "{:>4} wms {:>5} vms {:>4} vus {:>4} rus {:>4} cus {:>4} pus " - "{:>4} aus {:>4} sus {:>4} dus {:f}", height, transactions, inputs, + "{:>4} aus {:>4} sus {:>4} dus {:f}", transactions, inputs, // wms: wait total (ms) total_cost_ms(times.end_deserialize, times.start_check), diff --git a/src/protocols/protocol_transaction_in.cpp b/src/protocols/protocol_transaction_in.cpp index 909bac0..2420785 100644 --- a/src/protocols/protocol_transaction_in.cpp +++ b/src/protocols/protocol_transaction_in.cpp @@ -109,7 +109,7 @@ bool protocol_transaction_in::handle_receive_inventory(code const& ec, inventory // Remove hashes of (unspent) transactions that we already have. // BUGBUG: this removes spent transactions which it should not (see BIP30). - LOG_INFO(LOG_NODE, "send_get_transactions() - before filter_transactions - 1"); + // LOG_INFO(LOG_NODE, "send_get_transactions() - before filter_transactions - 1"); chain_.filter_transactions(response, BIND2(send_get_data, _1, response)); return true; } @@ -220,7 +220,7 @@ void protocol_transaction_in::send_get_transactions(transaction_const_ptr messag // treatment of duplicate hashes by other nodes and the fact that this is // a set of pool transactions only, this is okay. - LOG_INFO(LOG_NODE, "send_get_transactions() - before filter_transactions - 2"); + // LOG_INFO(LOG_NODE, "send_get_transactions() - before filter_transactions - 2"); chain_.filter_transactions(request, BIND2(send_get_data, _1, request)); }