diff options
author | j-berman <justinberman@protonmail.com> | 2023-09-26 20:37:11 -0700 |
---|---|---|
committer | j-berman <justinberman@protonmail.com> | 2023-09-26 20:37:11 -0700 |
commit | 47042ce80893556e31588e9987405b8900eb15e2 (patch) | |
tree | e5d6a4ee700eab3aa8c3108db192e2496b56e1da | |
parent | Merge pull request #8976 (diff) | |
download | monero-47042ce80893556e31588e9987405b8900eb15e2.tar.xz |
wallet2: call on_reorg callback in handle_reorg
-rw-r--r-- | src/wallet/wallet2.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/wallet/wallet2.cpp b/src/wallet/wallet2.cpp index fa9bbfde8..49f95b1a1 100644 --- a/src/wallet/wallet2.cpp +++ b/src/wallet/wallet2.cpp @@ -4252,9 +4252,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; } @@ -4266,7 +4263,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() |