aboutsummaryrefslogtreecommitdiff
path: root/src/wallet/wallet2.cpp
diff options
context:
space:
mode:
authorCrypto City <cryptocity@example.com>2019-11-17 21:12:46 +0000
committermoneromooo-monero <moneromooo-monero@users.noreply.github.com>2023-01-19 17:34:45 +0000
commit9c7d28b8ed86246795f9ea602d14c1fd3671a608 (patch)
tree6866d02daa1927b208af72b37bdf8e515162705c /src/wallet/wallet2.cpp
parentMerge pull request #8675 (diff)
downloadmonero-9c7d28b8ed86246795f9ea602d14c1fd3671a608.tar.xz
wallet2: add on_reorg callback
Diffstat (limited to 'src/wallet/wallet2.cpp')
-rw-r--r--src/wallet/wallet2.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/wallet/wallet2.cpp b/src/wallet/wallet2.cpp
index 9e99cac83..57cc1da8b 100644
--- a/src/wallet/wallet2.cpp
+++ b/src/wallet/wallet2.cpp
@@ -3780,7 +3780,7 @@ void wallet2::detach_blockchain(uint64_t height, std::map<std::pair<uint64_t, ui
transfers_detached = std::distance(it, m_transfers.end());
m_transfers.erase(it, m_transfers.end());
- size_t blocks_detached = m_blockchain.size() - height;
+ const uint64_t blocks_detached = m_blockchain.size() - height;
m_blockchain.crop(height);
for (auto it = m_payments.begin(); it != m_payments.end(); )
@@ -3799,6 +3799,9 @@ void wallet2::detach_blockchain(uint64_t height, std::map<std::pair<uint64_t, ui
++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);
}
//----------------------------------------------------------------------------------------------------