aboutsummaryrefslogtreecommitdiff
path: root/src/wallet/api/wallet.cpp
diff options
context:
space:
mode:
authorRiccardo Spagni <ric@spagni.net>2017-01-13 14:37:12 -0500
committerRiccardo Spagni <ric@spagni.net>2017-01-13 14:37:12 -0500
commit2a2f02e375d0db176b998af779e447ffe871b774 (patch)
tree9232a5dc4fed0bcdf31fbde230aab986e3f2eea5 /src/wallet/api/wallet.cpp
parentMerge pull request #1558 (diff)
parentWallet2 + API: Callbacks for unconfirmed transfers (diff)
downloadmonero-2a2f02e375d0db176b998af779e447ffe871b774.tar.xz
Merge pull request #1559
db56a03f Wallet2 + API: Callbacks for unconfirmed transfers (Jaquee)
Diffstat (limited to 'src/wallet/api/wallet.cpp')
-rw-r--r--src/wallet/api/wallet.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/wallet/api/wallet.cpp b/src/wallet/api/wallet.cpp
index 10a75d4c9..e8ae7c642 100644
--- a/src/wallet/api/wallet.cpp
+++ b/src/wallet/api/wallet.cpp
@@ -106,6 +106,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)
{