From 30a54790a6028817f1747e0e7ae2f585be1b26de Mon Sep 17 00:00:00 2001 From: sowle Date: Sat, 3 Jun 2023 04:05:12 +0200 Subject: [PATCH] useful warnings and other logging improvements --- src/currency_core/currency_basic_backward_comp.inl | 7 ++++--- src/currency_core/currency_format_utils.cpp | 4 ++++ src/currency_core/tx_pool.cpp | 4 ++-- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/src/currency_core/currency_basic_backward_comp.inl b/src/currency_core/currency_basic_backward_comp.inl index 1dd09309..7dffea0e 100644 --- a/src/currency_core/currency_basic_backward_comp.inl +++ b/src/currency_core/currency_basic_backward_comp.inl @@ -94,10 +94,11 @@ bool transition_convert(const transaction_current_t& from, transaction_v1& to) { if (s.type() == typeid(NLSAG_sig)) { - to.signatures.push_back(boost::get(s).s); ; - }else + to.signatures.push_back(boost::get(s).s); + } + else { - throw std::runtime_error("Unexpected type in signature_v"); + throw std::runtime_error(std::string("Unexpected type in tx.signatures during transition_convert: ") + s.type().name()); } } return true; diff --git a/src/currency_core/currency_format_utils.cpp b/src/currency_core/currency_format_utils.cpp index 946595db..19cbd0a2 100644 --- a/src/currency_core/currency_format_utils.cpp +++ b/src/currency_core/currency_format_utils.cpp @@ -2224,6 +2224,10 @@ namespace currency } } + if (zc_inputs_count != 0 && tx.version <= TRANSACTION_VERSION_PRE_HF4) + { + LOG_PRINT_YELLOW("WARNING: tx v1 should not use ZC inputs", LOG_LEVEL_0); + } // // OUTs diff --git a/src/currency_core/tx_pool.cpp b/src/currency_core/tx_pool.cpp index 8fcca00f..527dc76a 100644 --- a/src/currency_core/tx_pool.cpp +++ b/src/currency_core/tx_pool.cpp @@ -945,8 +945,8 @@ namespace currency return "(no transactions, the pool is empty)"; // sort output by receive time txs.sort([](const std::pair& lhs, const std::pair& rhs) -> bool { return lhs.second.receive_time < rhs.second.receive_time; }); - ss << "# | transaction id | size | fee | ins | outs | outs money | live_time | max used block | last failed block | kept by a block?" << ENDL; - // 1234 87157 0.10000111 2000 2000 112000.12345678 d0.h10.m16.s17 123456 <12345..> 123456 <12345..> YES + ss << "# | transaction id | size | fee | ins | outs | outs money | live_time | max used block | last failed block | kept by a block?" << ENDL; + // 1234 f99fe6d4335fc0ddd69e6880a4d95e0f6ea398de0324a6837021a61c6a31cacd 87157 0.10000111 2000 2000 112000.12345678 d0.h10.m16.s17 123456 <12345..> 123456 <12345..> YES size_t i = 0; for (auto& tx : txs) {