diff options
author | Jaquee <jaquee.monero@gmail.com> | 2017-08-05 17:01:50 +0200 |
---|---|---|
committer | Jaquee <jaquee.monero@gmail.com> | 2017-10-15 17:58:28 +0200 |
commit | 97c2e449ce97be1150f088fd0ec83213cf43a7f9 (patch) | |
tree | 146f7b78e3c78f687091f912581a8e29b0f7b249 /src/wallet/api | |
parent | walletAPI: correct confirmations in txHistory for unsynced wallets (diff) | |
download | monero-97c2e449ce97be1150f088fd0ec83213cf43a7f9.tar.xz |
wallet2+API: use separate callbacks for lightwallets
Diffstat (limited to 'src/wallet/api')
-rw-r--r-- | src/wallet/api/wallet.cpp | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/src/wallet/api/wallet.cpp b/src/wallet/api/wallet.cpp index 1eba791cf..db7e60cd7 100644 --- a/src/wallet/api/wallet.cpp +++ b/src/wallet/api/wallet.cpp @@ -155,6 +155,38 @@ struct Wallet2CallbackImpl : public tools::i_wallet2_callback // TODO; } + // Light wallet callbacks + virtual void on_lw_new_block(uint64_t height) + { + if (m_listener) { + m_listener->newBlock(height); + } + } + + virtual void on_lw_money_received(uint64_t height, const crypto::hash &txid, uint64_t amount) + { + if (m_listener) { + std::string tx_hash = epee::string_tools::pod_to_hex(txid); + m_listener->moneyReceived(tx_hash, amount); + } + } + + virtual void on_lw_unconfirmed_money_received(uint64_t height, const crypto::hash &txid, uint64_t amount) + { + if (m_listener) { + std::string tx_hash = epee::string_tools::pod_to_hex(txid); + m_listener->unconfirmedMoneyReceived(tx_hash, amount); + } + } + + virtual void on_lw_money_spent(uint64_t height, const crypto::hash &txid, uint64_t amount) + { + if (m_listener) { + std::string tx_hash = epee::string_tools::pod_to_hex(txid); + m_listener->moneySpent(tx_hash, amount); + } + } + WalletListener * m_listener; WalletImpl * m_wallet; }; |