diff --git a/patches/wownero/0007-FIX-wallet-listener-crashing.patch b/patches/wownero/0007-FIX-wallet-listener-crashing.patch new file mode 100644 index 00000000..fb92f682 --- /dev/null +++ b/patches/wownero/0007-FIX-wallet-listener-crashing.patch @@ -0,0 +1,58 @@ +From 1286d8b67484dd976997cccd726d4ea9318a6ecd Mon Sep 17 00:00:00 2001 +From: Czarek Nakamoto +Date: Tue, 2 Apr 2024 11:56:09 +0200 +Subject: [PATCH] FIX: wallet listener crashing + +--- + src/wallet/api/wallet.cpp | 21 +++++++++++++++------ + 1 file changed, 15 insertions(+), 6 deletions(-) + +diff --git a/src/wallet/api/wallet.cpp b/src/wallet/api/wallet.cpp +index 3bbc60d74..b42289842 100644 +--- a/src/wallet/api/wallet.cpp ++++ b/src/wallet/api/wallet.cpp +@@ -201,8 +201,11 @@ struct Wallet2CallbackImpl : public tools::i_wallet2_callback + << ", burnt: " << print_money(burnt) + << ", raw_output_value: " << print_money(amount) + << ", idx: " << subaddr_index); +- m_listener->moneyReceived(tx_hash, amount); +- m_listener->updated(); ++ // do not signal on sent tx if wallet is not syncronized completely ++ if (m_listener && m_wallet->synchronized()) { ++ m_listener->moneyReceived(tx_hash, amount); ++ m_listener->updated(); ++ } + } + + virtual void on_unconfirmed_money_received(uint64_t height, const crypto::hash &txid, const cryptonote::transaction& tx, uint64_t amount, const cryptonote::subaddress_index& subaddr_index) +@@ -214,8 +217,11 @@ struct Wallet2CallbackImpl : public tools::i_wallet2_callback + << ", tx: " << tx_hash + << ", amount: " << print_money(amount) + << ", idx: " << subaddr_index); +- m_listener->unconfirmedMoneyReceived(tx_hash, amount); +- m_listener->updated(); ++ // do not signal on sent tx if wallet is not syncronized completely ++ if (m_listener && m_wallet->synchronized()) { ++ m_listener->unconfirmedMoneyReceived(tx_hash, amount); ++ m_listener->updated(); ++ } + } + + virtual void on_money_spent(uint64_t height, const crypto::hash &txid, const cryptonote::transaction& in_tx, +@@ -227,8 +233,11 @@ struct Wallet2CallbackImpl : public tools::i_wallet2_callback + << ", tx: " << tx_hash + << ", amount: " << print_money(amount) + << ", idx: " << subaddr_index); +- m_listener->moneySpent(tx_hash, amount); +- m_listener->updated(); ++ // do not signal on sent tx if wallet is not syncronized completely ++ if (m_listener && m_wallet->synchronized()) { ++ m_listener->moneySpent(tx_hash, amount); ++ m_listener->updated(); ++ } + } + + virtual void on_skip_transaction(uint64_t height, const crypto::hash &txid, const cryptonote::transaction& tx) +-- +2.44.0 +