From 1cffbaa9b867ac840f2104595ce8bd407630ab78 Mon Sep 17 00:00:00 2001 From: sowle Date: Tue, 19 Mar 2024 18:30:54 +0100 Subject: [PATCH 1/4] ui update --- src/gui/qt-daemon/layout | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/qt-daemon/layout b/src/gui/qt-daemon/layout index f8e9556f..d593aa34 160000 --- a/src/gui/qt-daemon/layout +++ b/src/gui/qt-daemon/layout @@ -1 +1 @@ -Subproject commit f8e9556fbaccd49841ce91afc3c90c8e3142ac95 +Subproject commit d593aa3485395d7cc0415519dc1fc079de82e0ea From 5ba45867f79043b4883df96b0983bf76c7ac8622 Mon Sep 17 00:00:00 2001 From: zano build machine Date: Tue, 19 Mar 2024 20:32:04 +0300 Subject: [PATCH 2/4] === build number: 278 -> 279 === --- src/version.h.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/version.h.in b/src/version.h.in index 79c6174b..49405629 100644 --- a/src/version.h.in +++ b/src/version.h.in @@ -8,6 +8,6 @@ #define PROJECT_REVISION "0" #define PROJECT_VERSION PROJECT_MAJOR_VERSION "." PROJECT_MINOR_VERSION "." PROJECT_REVISION -#define PROJECT_VERSION_BUILD_NO 278 +#define PROJECT_VERSION_BUILD_NO 279 #define PROJECT_VERSION_BUILD_NO_STR STRINGIFY_EXPAND(PROJECT_VERSION_BUILD_NO) #define PROJECT_VERSION_LONG PROJECT_VERSION "." PROJECT_VERSION_BUILD_NO_STR "[" BUILD_COMMIT_ID "]" From 80e8392be0395674e6ca37c5136a632cf556c8c2 Mon Sep 17 00:00:00 2001 From: sowle Date: Tue, 19 Mar 2024 18:47:26 +0100 Subject: [PATCH 3/4] code clean-up and logging improvements --- src/currency_core/blockchain_storage.cpp | 6 +++++- src/currency_core/pos_mining.cpp | 9 ++++----- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/src/currency_core/blockchain_storage.cpp b/src/currency_core/blockchain_storage.cpp index 66764dfa..d19bb381 100644 --- a/src/currency_core/blockchain_storage.cpp +++ b/src/currency_core/blockchain_storage.cpp @@ -1910,7 +1910,11 @@ bool blockchain_storage::handle_alternative_block(const block& b, const crypto:: std::stringstream ss_pow_pos_info; if (pos_block) { - ss_pow_pos_info << "PoS:\t" << abei.stake_hash << ", stake amount: " << print_money(pos_amount) << ", final_difficulty: " << pos_diff_final; + ss_pow_pos_info << "PoS:\t" << abei.stake_hash << ", stake amount: "; + if (abei.bl.miner_tx.version >= TRANSACTION_VERSION_POST_HF4) + ss_pow_pos_info << "hidden"; + else + ss_pow_pos_info << print_money_brief(pos_amount) << ", final_difficulty: " << pos_diff_final; proof = abei.stake_hash; } else diff --git a/src/currency_core/pos_mining.cpp b/src/currency_core/pos_mining.cpp index 5bc1d973..478284d8 100644 --- a/src/currency_core/pos_mining.cpp +++ b/src/currency_core/pos_mining.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2022 Zano Project +// Copyright (c) 2022-2024 Zano Project // Distributed under the MIT/X11 software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. // @@ -56,7 +56,7 @@ namespace currency bool found = false; - if (this->zarcanum /* && td.is_zc() */) + if (this->zarcanum) { crypto::mp::uint256_t lhs; crypto::mp::uint512_t rhs; @@ -70,7 +70,7 @@ namespace currency const boost::multiprecision::uint256_t d_mp = lhs / (crypto::c_zarcanum_z_coeff_mp * this->stake_amount) + 1; const boost::multiprecision::uint256_t ba = d_mp * crypto::c_zarcanum_z_coeff_mp * this->stake_amount - lhs; const boost::multiprecision::uint256_t l_div_z_D = this->z_l_div_z_D / crypto::c_zarcanum_z_coeff_mp; - LOG_PRINT_GREEN("Found Zarcanum kernel: amount: " << currency::print_money_brief(this->stake_amount) << /* ", gindex: " << td.m_global_output_index << */ ENDL + LOG_PRINT_GREEN("Found Zarcanum kernel: amount: " << currency::print_money_brief(this->stake_amount) << ENDL << "difficulty: " << this->basic_diff << ENDL << "kernel info: " << ENDL << print_stake_kernel_info(this->sk) @@ -78,9 +78,8 @@ namespace currency << "lhs: 0x" << crypto::scalar_t(lhs).to_string_as_hex_number() << " = 0x" << std::hex << d_mp << " * 2^64 * " << this->stake_amount << " - 0x" << std::hex << ba << ENDL << "rhs: 0x" << crypto::scalar_t(rhs).to_string_as_hex_number() << ENDL << "d: 0x" << std::hex << d_mp << ENDL - << "l / floor(z * D): 0x" << std::hex << l_div_z_D + << "floor(l / z * D): 0x" << std::hex << l_div_z_D , LOG_LEVEL_0); - } } else From f15a8421f9f047e9a1bee9cfbc457b056e5e0616 Mon Sep 17 00:00:00 2001 From: cryptozoidberg Date: Wed, 20 Mar 2024 17:49:03 +0100 Subject: [PATCH 4/4] added call_wallet_rpc to avoid using of mw_select_wallet --- src/gui/qt-daemon/application/mainwindow.cpp | 20 ++++++++++++++++++++ src/gui/qt-daemon/application/mainwindow.h | 1 + 2 files changed, 21 insertions(+) diff --git a/src/gui/qt-daemon/application/mainwindow.cpp b/src/gui/qt-daemon/application/mainwindow.cpp index 0e3c974e..9f4f0313 100644 --- a/src/gui/qt-daemon/application/mainwindow.cpp +++ b/src/gui/qt-daemon/application/mainwindow.cpp @@ -301,6 +301,26 @@ QString MainWindow::call_rpc(const QString& params) return QString::fromStdString(response_info.m_body); CATCH_ENTRY_FAIL_API_RESPONCE(); } + +QString MainWindow::call_wallet_rpc(const QString& wallet_id_str, const QString& params) +{ + TRY_ENTRY(); + + if (!m_backend.is_core_initialized()) + { + epee::json_rpc::error_response rsp; + rsp.jsonrpc = "2.0"; + rsp.error.code = -1; + rsp.error.message = API_RETURN_CODE_CORE_BUSY; + return QString::fromStdString(epee::serialization::store_t_to_json(static_cast(rsp))); + } + + uint64_t wallet_id = std::stoull(wallet_id_str.toStdString()); + + return QString::fromStdString(m_backend.invoke(wallet_id, params.toStdString())); + CATCH_ENTRY_FAIL_API_RESPONCE(); +} + QString MainWindow::get_default_fee(const QString& param) { TRY_ENTRY(); diff --git a/src/gui/qt-daemon/application/mainwindow.h b/src/gui/qt-daemon/application/mainwindow.h index c2725682..c0df8862 100644 --- a/src/gui/qt-daemon/application/mainwindow.h +++ b/src/gui/qt-daemon/application/mainwindow.h @@ -198,6 +198,7 @@ public: QString request_dummy(const QString& param); QString call_rpc(const QString& params); + QString call_wallet_rpc(const QString& wallet_id, const QString& params); signals: void quit_requested(const QString str);