From db56a03ff2820f85da21c3c8fc4cc60e64c5b88d Mon Sep 17 00:00:00 2001 From: Jaquee Date: Thu, 12 Jan 2017 18:23:23 +0100 Subject: Wallet2 + API: Callbacks for unconfirmed transfers --- src/wallet/api/wallet.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'src/wallet/api/wallet.cpp') diff --git a/src/wallet/api/wallet.cpp b/src/wallet/api/wallet.cpp index da5f776f4..a9e46728b 100644 --- a/src/wallet/api/wallet.cpp +++ b/src/wallet/api/wallet.cpp @@ -103,6 +103,21 @@ struct Wallet2CallbackImpl : public tools::i_wallet2_callback } } + virtual void on_unconfirmed_money_received(uint64_t height, const cryptonote::transaction& tx, uint64_t amount) + { + + std::string tx_hash = epee::string_tools::pod_to_hex(get_transaction_hash(tx)); + + LOG_PRINT_L3(__FUNCTION__ << ": unconfirmed money received. height: " << height + << ", tx: " << tx_hash + << ", amount: " << print_money(amount)); + // do not signal on received tx if wallet is not syncronized completely + if (m_listener && m_wallet->synchronized()) { + m_listener->unconfirmedMoneyReceived(tx_hash, amount); + m_listener->updated(); + } + } + virtual void on_money_spent(uint64_t height, const cryptonote::transaction& in_tx, uint64_t amount, const cryptonote::transaction& spend_tx) { -- cgit v1.2.3