Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions include/kth/node/executor/executor.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ class executor {

private:
bool wait_for_signal_and_close();
void print_ascii_art();

static
void stop(kth::code const& ec);
Expand All @@ -73,6 +74,7 @@ class executor {
static
std::promise<kth::code> stopping_;

bool stdout_enabled_;
kth::node::configuration config_;
kth::node::full_node::ptr node_;
kth::handle0 run_handler_;
Expand Down
29 changes: 28 additions & 1 deletion src/executor/executor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,8 @@ static auto const mode = std::ofstream::out | std::ofstream::app;
std::promise<kth::code> 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;
Expand Down Expand Up @@ -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 {
Expand Down
4 changes: 2 additions & 2 deletions src/protocols/protocol_block_in.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 "
Comment thread
fpelliccioni marked this conversation as resolved.
"{:>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),
Expand Down
4 changes: 2 additions & 2 deletions src/protocols/protocol_transaction_in.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Comment thread
fpelliccioni marked this conversation as resolved.
chain_.filter_transactions(response, BIND2(send_get_data, _1, response));
return true;
}
Expand Down Expand Up @@ -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");
Comment thread
fpelliccioni marked this conversation as resolved.
chain_.filter_transactions(request, BIND2(send_get_data, _1, request));
}

Expand Down