From 2a38bf29618a8ce163f9d6f83b7ae86924752e32 Mon Sep 17 00:00:00 2001 From: cyan Date: Wed, 4 Dec 2024 10:22:48 -0500 Subject: cleanup patches (and other stuff) (#79) * cleanup patches * fix polyseed patch * Fix iOS builds * fix polyseed dependencies * fix polyseed patch for macOS * update ledger patch * update wownero patches and version * update checksums * wip" * update gitmodules * update boost build script * update build_single.sh * vix verbosey_copy * fix __clear_cache bug on wownero * update randomwow * migrate build system * fix cross compilation issues * some more build issue * update polyseed * cleanup cmakelists * fix toolchain.cmake.in * add ssp * another attempt at building windows on CI * fix package name * migrate mirror to my own hosting * change download mirror priority (fallback first) * link ssp in monero module as well by using CMAKE_{C,CXX}_FLAGS * fix android builds * update polyseed source * 13 -> trixie * fix package name conflicts, update runner to sid * update boost to 1_84_0, disable patch that's no longer needed * switch to ubuntu:24.04 * add POLYSEED_STATIC to toolchain.cmake.in in order to properly link * drop patches * fixes to darwin * link missing wowner-seed library * a litte bit more of experiments * build locale only on windows * update iconv * update definitions * update ci builds * update my progress * ios fix, update depends, ci * multithread build system * fix android, mingw and linux build issues * remove dependency check * update Dockerfile to include pigz * show a message when pigz is missing * fix devcontainer mingw setup (missing ENV) * update android build runner * sailfishos dropped (you better go behave yourself and run actual linux programs) * fiz pigz issues * install llvm-ranlib for android * fix iOS build issues * fix dummy ledger patch * fix macos and darwin * fix macos ci * fix macos build command * install autoconf * add automake * add libtool * macos fixes, wownero fixes, idk what else, please help me * fix wownero iOS build * Cleanup patches * add try-catch into monero code * fix error handling * update checksums --- patches/wownero/0004-airgap.patch | 170 -------------------------------------- 1 file changed, 170 deletions(-) delete mode 100644 patches/wownero/0004-airgap.patch (limited to 'patches/wownero/0004-airgap.patch') diff --git a/patches/wownero/0004-airgap.patch b/patches/wownero/0004-airgap.patch deleted file mode 100644 index 4bdd4ef..0000000 --- a/patches/wownero/0004-airgap.patch +++ /dev/null @@ -1,170 +0,0 @@ -From dd3b82ecf391fbaa91d16634198e58fa9ed0091f Mon Sep 17 00:00:00 2001 -From: tobtoht -Date: Tue, 26 Mar 2024 09:06:32 +0100 -Subject: [PATCH 04/14] airgap - ---- - src/wallet/api/wallet.cpp | 23 +++++++++++++++++++++++ - src/wallet/api/wallet.h | 2 ++ - src/wallet/api/wallet2_api.h | 3 +++ - src/wallet/wallet2.cpp | 28 ++++++++++++++++++++++------ - src/wallet/wallet2.h | 1 + - 5 files changed, 51 insertions(+), 6 deletions(-) - -diff --git a/src/wallet/api/wallet.cpp b/src/wallet/api/wallet.cpp -index 27a4dc6c8..4b2693f23 100644 ---- a/src/wallet/api/wallet.cpp -+++ b/src/wallet/api/wallet.cpp -@@ -1172,6 +1172,24 @@ uint64_t WalletImpl::unlockedBalance(uint32_t accountIndex) const - return m_wallet->unlocked_balance(accountIndex, false); - } - -+uint64_t WalletImpl::viewOnlyBalance(uint32_t accountIndex, const std::vector &key_images) const -+{ -+ clearStatus(); -+ -+ std::vector kis; -+ for (const auto &key_image : key_images) { -+ crypto::key_image ki; -+ if (!epee::string_tools::hex_to_pod(key_image, ki)) -+ { -+ setStatusError(tr("failed to parse key image")); -+ return 0; -+ } -+ kis.push_back(ki); -+ } -+ -+ return m_wallet->view_only_balance(accountIndex, kis); -+} -+ - uint64_t WalletImpl::blockChainHeight() const - { - if(m_wallet->light_wallet()) { -@@ -1376,6 +1394,11 @@ bool WalletImpl::submitTransaction(const string &fileName) { - return true; - } - -+bool WalletImpl::hasUnknownKeyImages() const -+{ -+ return m_wallet->has_unknown_key_images(); -+} -+ - bool WalletImpl::exportKeyImages(const string &filename, bool all) - { - if (m_wallet->watch_only()) -diff --git a/src/wallet/api/wallet.h b/src/wallet/api/wallet.h -index fc6341861..7b885e866 100644 ---- a/src/wallet/api/wallet.h -+++ b/src/wallet/api/wallet.h -@@ -130,6 +130,7 @@ public: - bool setProxy(const std::string &address) override; - uint64_t balance(uint32_t accountIndex = 0) const override; - uint64_t unlockedBalance(uint32_t accountIndex = 0) const override; -+ uint64_t viewOnlyBalance(uint32_t accountIndex, const std::vector &key_images) const override; - uint64_t blockChainHeight() const override; - uint64_t approximateBlockChainHeight() const override; - uint64_t estimateBlockChainHeight() const override; -@@ -190,6 +191,7 @@ public: - virtual UnsignedTransaction * loadUnsignedTx(const std::string &unsigned_filename) override; - virtual UnsignedTransaction * loadUnsignedTxFromStr(const std::string &unsigned_tx) override; - virtual UnsignedTransaction * loadUnsignedTxFromBase64Str(const std::string &unsigned_tx) override; -+ bool hasUnknownKeyImages() const override; - virtual PendingTransaction * loadSignedTx(const std::string &signed_filename) override; - bool exportKeyImages(const std::string &filename, bool all = false) override; - bool importKeyImages(const std::string &filename) override; -diff --git a/src/wallet/api/wallet2_api.h b/src/wallet/api/wallet2_api.h -index db5509227..5dcaeaaab 100644 ---- a/src/wallet/api/wallet2_api.h -+++ b/src/wallet/api/wallet2_api.h -@@ -726,6 +726,7 @@ struct Wallet - result += unlockedBalance(i); - return result; - } -+ virtual uint64_t viewOnlyBalance(uint32_t accountIndex, const std::vector &key_images = {}) const = 0; - - /** - * @brief watchOnly - checks if wallet is watch only -@@ -1045,6 +1046,8 @@ struct Wallet - virtual uint64_t estimateTransactionFee(const std::vector> &destinations, - PendingTransaction::Priority priority) const = 0; - -+ virtual bool hasUnknownKeyImages() const = 0; -+ - /*! - * \brief exportKeyImages - exports key images to file - * \param filename -diff --git a/src/wallet/wallet2.cpp b/src/wallet/wallet2.cpp -index e013313b9..2a5f17a9f 100644 ---- a/src/wallet/wallet2.cpp -+++ b/src/wallet/wallet2.cpp -@@ -7432,6 +7432,25 @@ uint64_t wallet2::unlocked_balance(uint32_t index_major, bool strict, uint64_t * - return amount; - } - //---------------------------------------------------------------------------------------------------- -+uint64_t wallet2::view_only_balance(uint32_t index_major, const std::vector& selected_inputs) -+{ -+ uint64_t amount = 0; -+ for (const auto &td : m_transfers) { -+ if (is_preferred_input(selected_inputs, td.m_key_image) && -+ !is_spent(td, false) && -+ !td.m_frozen && -+ !td.m_key_image_partial && -+ td.m_key_image_known && -+ td.is_rct() && -+ is_transfer_unlocked(td) && -+ td.m_subaddr_index.major == index_major) -+ { -+ amount += td.m_amount; -+ } -+ } -+ return amount; -+} -+//---------------------------------------------------------------------------------------------------- - std::map wallet2::balance_per_subaddress(uint32_t index_major, bool strict) const - { - std::map amount_per_subaddr; -@@ -8282,9 +8301,7 @@ bool wallet2::sign_tx(unsigned_tx_set &exported_txs, std::vector additional_derivations; - -- // compute public keys from out secret keys -- crypto::public_key tx_pub_key; -- crypto::secret_key_to_public_key(txs[n].tx_key, tx_pub_key); -+ crypto::public_key tx_pub_key = get_tx_pub_key_from_extra(tx); - std::vector additional_tx_pub_keys; - for (const crypto::secret_key &skey: txs[n].additional_tx_keys) - { -@@ -11692,7 +11709,7 @@ std::vector wallet2::create_transactions_2(std::vector m_ignore_outputs_above || td.amount() < m_ignore_outputs_below) - { -@@ -11742,8 +11759,7 @@ std::vector wallet2::create_transactions_2(std::vector(); -+ THROW_WALLET_EXCEPTION_IF(unused_dust_indices_per_subaddr.empty() && unused_transfers_indices_per_subaddr.empty(), error::wallet_internal_error, "No enotes available to spend") - - // if empty, put dummy entry so that the front can be referenced later in the loop - if (unused_dust_indices_per_subaddr.empty()) -diff --git a/src/wallet/wallet2.h b/src/wallet/wallet2.h -index 009dce766..294a2d1f6 100644 ---- a/src/wallet/wallet2.h -+++ b/src/wallet/wallet2.h -@@ -1173,6 +1173,7 @@ private: - // locked & unlocked balance of given or current subaddress account - uint64_t balance(uint32_t subaddr_index_major, bool strict) const; - uint64_t unlocked_balance(uint32_t subaddr_index_major, bool strict, uint64_t *blocks_to_unlock = NULL, uint64_t *time_to_unlock = NULL); -+ uint64_t view_only_balance(uint32_t index_major, const std::vector& selected_inputs = {}); - // locked & unlocked balance per subaddress of given or current subaddress account - std::map balance_per_subaddress(uint32_t subaddr_index_major, bool strict) const; - std::map>> unlocked_balance_per_subaddress(uint32_t subaddr_index_major, bool strict); --- -2.45.2 - -- cgit v1.2.3