Skip to content

Commit

Permalink
add wownero patch so it won't crash
Browse files Browse the repository at this point in the history
  • Loading branch information
MrCyjaneK committed Apr 2, 2024
1 parent 6f3f187 commit e4cde6d
Showing 1 changed file with 58 additions and 0 deletions.
58 changes: 58 additions & 0 deletions patches/wownero/0007-FIX-wallet-listener-crashing.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
From 1286d8b67484dd976997cccd726d4ea9318a6ecd Mon Sep 17 00:00:00 2001
From: Czarek Nakamoto <[email protected]>
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

0 comments on commit e4cde6d

Please sign in to comment.