From 9c7d28b8ed86246795f9ea602d14c1fd3671a608 Mon Sep 17 00:00:00 2001 From: Crypto City Date: Sun, 17 Nov 2019 21:12:46 +0000 Subject: wallet2: add on_reorg callback --- src/wallet/wallet2.cpp | 5 ++++- src/wallet/wallet2.h | 1 + 2 files changed, 5 insertions(+), 1 deletion(-) (limited to 'src') 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::mapon_reorg(height, blocks_detached, transfers_detached); + LOG_PRINT_L0("Detached blockchain on height " << height << ", transfers detached " << transfers_detached << ", blocks detached " << blocks_detached); } //---------------------------------------------------------------------------------------------------- diff --git a/src/wallet/wallet2.h b/src/wallet/wallet2.h index 3ee40a5f0..936d1c4e7 100644 --- a/src/wallet/wallet2.h +++ b/src/wallet/wallet2.h @@ -138,6 +138,7 @@ private: public: // Full wallet callbacks virtual void on_new_block(uint64_t height, const cryptonote::block& block) {} + virtual void on_reorg(uint64_t height, uint64_t blocks_detached, size_t transfers_detached) {} virtual void on_money_received(uint64_t height, const crypto::hash &txid, const cryptonote::transaction& tx, uint64_t amount, uint64_t burnt, const cryptonote::subaddress_index& subaddr_index, bool is_change, uint64_t unlock_time) {} virtual void on_unconfirmed_money_received(uint64_t height, const crypto::hash &txid, const cryptonote::transaction& tx, uint64_t amount, const cryptonote::subaddress_index& subaddr_index) {} virtual void on_money_spent(uint64_t height, const crypto::hash &txid, const cryptonote::transaction& in_tx, uint64_t amount, const cryptonote::transaction& spend_tx, const cryptonote::subaddress_index& subaddr_index) {} -- cgit v1.2.3