diff options
author | luigi1111 <luigi1111w@gmail.com> | 2023-04-25 11:13:44 -0400 |
---|---|---|
committer | luigi1111 <luigi1111w@gmail.com> | 2023-04-25 11:13:44 -0400 |
commit | aa5382c4703954470c657a890594ea72a7d4a11e (patch) | |
tree | e6a1cdd4dc0d9c89667be5134809667ec1d4a1e6 /src/wallet/wallet2.cpp | |
parent | Merge pull request #8698 (diff) | |
parent | wallet2: add on_reorg callback (diff) | |
download | monero-aa5382c4703954470c657a890594ea72a7d4a11e.tar.xz |
Merge pull request #8716
9c7d28b wallet2: add on_reorg callback (Crypto City)
Diffstat (limited to 'src/wallet/wallet2.cpp')
-rw-r--r-- | src/wallet/wallet2.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/wallet/wallet2.cpp b/src/wallet/wallet2.cpp index 5136b71f0..6c474abc7 100644 --- a/src/wallet/wallet2.cpp +++ b/src/wallet/wallet2.cpp @@ -3980,7 +3980,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(); ) @@ -3999,6 +3999,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); } //---------------------------------------------------------------------------------------------------- |