diff --git a/src/wallet/wallet2.cpp b/src/wallet/wallet2.cpp index f45acb175..e9c48f9a8 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 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()