Merge pull request #9008
9a89e2d
wallet2: call on_reorg callback in handle_reorg (j-berman)1df5630
wallet2: add on_reorg callback (Crypto City)
This commit is contained in:
commit
81f113dd8c
|
@ -4324,7 +4324,10 @@ void wallet2::handle_reorg(uint64_t height, std::map<std::pair<uint64_t, uint64_
|
||||||
// C
|
// C
|
||||||
THROW_WALLET_EXCEPTION_IF(height < m_blockchain.offset() && m_blockchain.size() > m_blockchain.offset(),
|
THROW_WALLET_EXCEPTION_IF(height < m_blockchain.offset() && m_blockchain.size() > m_blockchain.offset(),
|
||||||
error::wallet_internal_error, "Daemon claims reorg below last checkpoint");
|
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()
|
bool wallet2::deinit()
|
||||||
|
|
|
@ -139,6 +139,7 @@ private:
|
||||||
public:
|
public:
|
||||||
// Full wallet callbacks
|
// Full wallet callbacks
|
||||||
virtual void on_new_block(uint64_t height, const cryptonote::block& block) {}
|
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_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_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) {}
|
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) {}
|
||||||
|
|
Loading…
Reference in New Issue