aboutsummaryrefslogtreecommitdiff
path: root/src/wallet/wallet2.cpp
diff options
context:
space:
mode:
authorj-berman <justinberman@protonmail.com>2023-09-26 20:37:11 -0700
committerj-berman <justinberman@protonmail.com>2023-09-27 12:51:52 -0700
commit9a89e2d9e4704f3c18f9b299342fc8a403a85de8 (patch)
tree7a8d4318e6c7c1abaa8f6ff74a2945ef34843ac4 /src/wallet/wallet2.cpp
parentwallet2: add on_reorg callback (diff)
downloadmonero-9a89e2d9e4704f3c18f9b299342fc8a403a85de8.tar.xz
wallet2: call on_reorg callback in handle_reorg
Diffstat (limited to '')
-rw-r--r--src/wallet/wallet2.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/wallet/wallet2.cpp b/src/wallet/wallet2.cpp
index 86307a6d3..026ecf0f6 100644
--- a/src/wallet/wallet2.cpp
+++ b/src/wallet/wallet2.cpp
@@ -4313,9 +4313,6 @@ wallet2::detached_blockchain_data wallet2::detach_blockchain(uint64_t height, st
++it;
}
- if (m_callback)
- m_callback->on_reorg(height, blocks_detached, transfers_detached);
-
LOG_PRINT_L0("Detached blockchain on height " << height << ", transfers detached " << transfers_detached << ", blocks detached " << blocks_detached);
return dbd;
}
@@ -4327,7 +4324,10 @@ void wallet2::handle_reorg(uint64_t height, std::map<std::pair<uint64_t, uint64_
// C
THROW_WALLET_EXCEPTION_IF(height < m_blockchain.offset() && m_blockchain.size() > m_blockchain.offset(),
error::wallet_internal_error, "Daemon claims reorg below last checkpoint");
- detach_blockchain(height, output_tracker_cache);
+ detached_blockchain_data dbd = detach_blockchain(height, output_tracker_cache);
+
+ if (m_callback)
+ m_callback->on_reorg(height, dbd.detached_blockchain.size(), dbd.detached_tx_hashes.size());
}
//----------------------------------------------------------------------------------------------------
bool wallet2::deinit()