summaryrefslogtreecommitdiff
path: root/patches/wownero
diff options
context:
space:
mode:
authorCzarek Nakamoto <cyjan@mrcyjanek.net>2024-04-02 11:57:38 +0200
committerCzarek Nakamoto <cyjan@mrcyjanek.net>2024-04-02 11:57:38 +0200
commite4cde6dfb8c8283fdfebe35669101a9a67eef80b (patch)
treefe761a2134650a149f4fffb7e5155c2f947799f7 /patches/wownero
parent6f3f187592b1404cf8f25180b2156e83472f74d5 (diff)
add wownero patch so it won't crash
Diffstat (limited to 'patches/wownero')
-rw-r--r--patches/wownero/0007-FIX-wallet-listener-crashing.patch58
1 files changed, 58 insertions, 0 deletions
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 0000000..fb92f68
--- /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 <cyjan@mrcyjanek.net>
+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
+