diff options
| author | cyan <cyjan@mrcyjanek.net> | 2024-12-04 10:22:48 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-12-04 10:22:48 -0500 |
| commit | 2a38bf29618a8ce163f9d6f83b7ae86924752e32 (patch) | |
| tree | 585af02d98d0d042d7b873c5af96b80ddf776b08 /patches/wownero/0005-coin-control.patch | |
| parent | 40c1a1bda4b6f125c702f5a37ecc48a6ebec24b8 (diff) | |
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
Diffstat (limited to 'patches/wownero/0005-coin-control.patch')
| -rw-r--r-- | patches/wownero/0005-coin-control.patch | 225 |
1 files changed, 0 insertions, 225 deletions
diff --git a/patches/wownero/0005-coin-control.patch b/patches/wownero/0005-coin-control.patch deleted file mode 100644 index 4502af5..0000000 --- a/patches/wownero/0005-coin-control.patch +++ /dev/null @@ -1,225 +0,0 @@ -From 820424507f43711e5e6b31a68dfda7e430cdae9d Mon Sep 17 00:00:00 2001 -From: tobtoht <tob@featherwallet.org> -Date: Wed, 27 Mar 2024 16:31:36 +0100 -Subject: [PATCH 05/14] coin control - ---- - src/wallet/api/coins.cpp | 62 ++++++++++++++++++++++++++++++++++++ - src/wallet/api/coins.h | 4 +++ - src/wallet/api/wallet.cpp | 4 +-- - src/wallet/api/wallet2_api.h | 3 ++ - src/wallet/wallet2.cpp | 22 +++++++++++++ - src/wallet/wallet2.h | 4 +++ - 6 files changed, 97 insertions(+), 2 deletions(-) - -diff --git a/src/wallet/api/coins.cpp b/src/wallet/api/coins.cpp -index fe54b82cf..5ce69b5b9 100644 ---- a/src/wallet/api/coins.cpp -+++ b/src/wallet/api/coins.cpp -@@ -90,6 +90,26 @@ namespace Monero { - } - } - -+ void CoinsImpl::setFrozen(std::string public_key) -+ { -+ crypto::public_key pk; -+ if (!epee::string_tools::hex_to_pod(public_key, pk)) -+ { -+ LOG_ERROR("Invalid public key: " << public_key); -+ return; -+ } -+ -+ try -+ { -+ m_wallet->m_wallet->freeze(pk); -+ refresh(); -+ } -+ catch (const std::exception& e) -+ { -+ LOG_ERROR("setFrozen: " << e.what()); -+ } -+ } -+ - void CoinsImpl::setFrozen(int index) - { - try -@@ -103,6 +123,26 @@ namespace Monero { - } - } - -+ void CoinsImpl::thaw(std::string public_key) -+ { -+ crypto::public_key pk; -+ if (!epee::string_tools::hex_to_pod(public_key, pk)) -+ { -+ LOG_ERROR("Invalid public key: " << public_key); -+ return; -+ } -+ -+ try -+ { -+ m_wallet->m_wallet->thaw(pk); -+ refresh(); -+ } -+ catch (const std::exception& e) -+ { -+ LOG_ERROR("thaw: " << e.what()); -+ } -+ } -+ - void CoinsImpl::thaw(int index) - { - try -@@ -120,4 +160,26 @@ namespace Monero { - return m_wallet->m_wallet->is_transfer_unlocked(unlockTime, blockHeight); - } - -+ void CoinsImpl::setDescription(const std::string &public_key, const std::string &description) -+ { -+ crypto::public_key pk; -+ if (!epee::string_tools::hex_to_pod(public_key, pk)) -+ { -+ LOG_ERROR("Invalid public key: " << public_key); -+ return; -+ } -+ -+ try -+ { -+ const size_t index = m_wallet->m_wallet->get_transfer_details(pk); -+ const tools::wallet2::transfer_details &td = m_wallet->m_wallet->get_transfer_details(index); -+ m_wallet->m_wallet->set_tx_note(td.m_txid, description); -+ refresh(); -+ } -+ catch (const std::exception& e) -+ { -+ LOG_ERROR("setDescription: " << e.what()); -+ } -+ } -+ - } // namespace -diff --git a/src/wallet/api/coins.h b/src/wallet/api/coins.h -index 3293d8ae9..bcd8b517f 100644 ---- a/src/wallet/api/coins.h -+++ b/src/wallet/api/coins.h -@@ -18,11 +18,15 @@ namespace Monero { - std::vector<CoinsInfo*> getAll() const override; - void refresh() override; - -+ void setFrozen(std::string public_key) override; - void setFrozen(int index) override; -+ void thaw(std::string public_key) override; - void thaw(int index) override; - - bool isTransferUnlocked(uint64_t unlockTime, uint64_t blockHeight) override; - -+ void setDescription(const std::string &public_key, const std::string &description) override; -+ - private: - WalletImpl *m_wallet; - std::vector<CoinsInfo*> m_rows; -diff --git a/src/wallet/api/wallet.cpp b/src/wallet/api/wallet.cpp -index 4b2693f23..ed309de34 100644 ---- a/src/wallet/api/wallet.cpp -+++ b/src/wallet/api/wallet.cpp -@@ -2018,11 +2018,11 @@ PendingTransaction *WalletImpl::createTransactionMultDest(const std::vector<stri - if (amount) { - transaction->m_pending_tx = m_wallet->create_transactions_2(dsts, fake_outs_count, 0 /* unlock_time */, - adjusted_priority, -- extra, subaddr_account, subaddr_indices); -+ extra, subaddr_account, subaddr_indices, {}, preferred_input_list); - } else { - transaction->m_pending_tx = m_wallet->create_transactions_all(0, info.address, info.is_subaddress, 1, fake_outs_count, 0 /* unlock_time */, - adjusted_priority, -- extra, subaddr_account, subaddr_indices); -+ extra, subaddr_account, subaddr_indices, preferred_input_list); - } - pendingTxPostProcess(transaction); - -diff --git a/src/wallet/api/wallet2_api.h b/src/wallet/api/wallet2_api.h -index 5dcaeaaab..347e6d002 100644 ---- a/src/wallet/api/wallet2_api.h -+++ b/src/wallet/api/wallet2_api.h -@@ -352,9 +352,12 @@ struct Coins - virtual CoinsInfo * coin(int index) const = 0; - virtual std::vector<CoinsInfo*> getAll() const = 0; - virtual void refresh() = 0; -+ virtual void setFrozen(std::string public_key) = 0; - virtual void setFrozen(int index) = 0; - virtual void thaw(int index) = 0; -+ virtual void thaw(std::string public_key) = 0; - virtual bool isTransferUnlocked(uint64_t unlockTime, uint64_t blockHeight) = 0; -+ virtual void setDescription(const std::string &public_key, const std::string &description) = 0; - }; - - struct SubaddressRow { -diff --git a/src/wallet/wallet2.cpp b/src/wallet/wallet2.cpp -index 2a5f17a9f..2b3eaad2e 100644 ---- a/src/wallet/wallet2.cpp -+++ b/src/wallet/wallet2.cpp -@@ -2094,11 +2094,21 @@ bool wallet2::frozen(const multisig_tx_set& txs) const - return false; - } - //---------------------------------------------------------------------------------------------------- -+void wallet2::freeze(const crypto::public_key &pk) -+{ -+ freeze(get_transfer_details(pk)); -+} -+//---------------------------------------------------------------------------------------------------- - void wallet2::freeze(const crypto::key_image &ki) - { - freeze(get_transfer_details(ki)); - } - //---------------------------------------------------------------------------------------------------- -+void wallet2::thaw(const crypto::public_key &pk) -+{ -+ thaw(get_transfer_details(pk)); -+} -+//---------------------------------------------------------------------------------------------------- - void wallet2::thaw(const crypto::key_image &ki) - { - thaw(get_transfer_details(ki)); -@@ -2109,6 +2119,18 @@ bool wallet2::frozen(const crypto::key_image &ki) const - return frozen(get_transfer_details(ki)); - } - //---------------------------------------------------------------------------------------------------- -+size_t wallet2::get_transfer_details(const crypto::public_key &pk) const -+{ -+ for (size_t idx = 0; idx < m_transfers.size(); ++idx) -+ { -+ const transfer_details &td = m_transfers[idx]; -+ if (td.get_public_key() == pk) { -+ return idx; -+ } -+ } -+ CHECK_AND_ASSERT_THROW_MES(false, "Public key not found"); -+} -+//---------------------------------------------------------------------------------------------------- - size_t wallet2::get_transfer_details(const crypto::key_image &ki) const - { - for (size_t idx = 0; idx < m_transfers.size(); ++idx) -diff --git a/src/wallet/wallet2.h b/src/wallet/wallet2.h -index 294a2d1f6..d1e68baac 100644 ---- a/src/wallet/wallet2.h -+++ b/src/wallet/wallet2.h -@@ -1563,6 +1563,8 @@ private: - uint64_t get_num_rct_outputs(); - size_t get_num_transfer_details() const { return m_transfers.size(); } - const transfer_details &get_transfer_details(size_t idx) const; -+ size_t get_transfer_details(const crypto::public_key &pk) const; -+ - - uint8_t get_current_hard_fork(); - void get_hard_fork_info(uint8_t version, uint64_t &earliest_height); -@@ -1793,7 +1795,9 @@ private: - void freeze(size_t idx); - void thaw(size_t idx); - bool frozen(size_t idx) const; -+ void freeze(const crypto::public_key &pk); - void freeze(const crypto::key_image &ki); -+ void thaw(const crypto::public_key &pk); - void thaw(const crypto::key_image &ki); - bool frozen(const crypto::key_image &ki) const; - bool frozen(const transfer_details &td) const; --- -2.45.2 - |
