aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRiccardo Spagni <ric@spagni.net>2017-03-03 16:59:32 +0200
committerRiccardo Spagni <ric@spagni.net>2017-03-03 16:59:32 +0200
commit4e92ef4aa4f2272cf4187420e6d5e4aa331ff6e3 (patch)
treeba8ab56785b5204d3918efd8c46d85a749e24dfe
parentMerge pull request #1827 (diff)
parentwallet api: fix parameters in wallet2callbackImpl (diff)
downloadmonero-4e92ef4aa4f2272cf4187420e6d5e4aa331ff6e3.tar.xz
Merge pull request #1831
9ae33b51 wallet api: fix parameters in wallet2callbackImpl (Jaquee) 1cf2f5a5 use txid in wallet2::process_new_transaction() (Jaquee)
-rw-r--r--src/wallet/api/wallet.cpp14
-rw-r--r--src/wallet/wallet2.cpp2
2 files changed, 8 insertions, 8 deletions
diff --git a/src/wallet/api/wallet.cpp b/src/wallet/api/wallet.cpp
index 99645189a..963bbe0ab 100644
--- a/src/wallet/api/wallet.cpp
+++ b/src/wallet/api/wallet.cpp
@@ -99,10 +99,10 @@ struct Wallet2CallbackImpl : public tools::i_wallet2_callback
}
}
- virtual void on_money_received(uint64_t height, const cryptonote::transaction& tx, uint64_t amount)
+ virtual void on_money_received(uint64_t height, const crypto::hash &txid, uint64_t amount)
{
- std::string tx_hash = epee::string_tools::pod_to_hex(get_transaction_hash(tx));
+ std::string tx_hash = epee::string_tools::pod_to_hex(txid);
LOG_PRINT_L3(__FUNCTION__ << ": money received. height: " << height
<< ", tx: " << tx_hash
@@ -114,10 +114,10 @@ struct Wallet2CallbackImpl : public tools::i_wallet2_callback
}
}
- virtual void on_unconfirmed_money_received(uint64_t height, const cryptonote::transaction& tx, uint64_t amount)
+ virtual void on_unconfirmed_money_received(uint64_t height, const crypto::hash &txid, uint64_t amount)
{
- std::string tx_hash = epee::string_tools::pod_to_hex(get_transaction_hash(tx));
+ std::string tx_hash = epee::string_tools::pod_to_hex(txid);
LOG_PRINT_L3(__FUNCTION__ << ": unconfirmed money received. height: " << height
<< ", tx: " << tx_hash
@@ -129,11 +129,11 @@ struct Wallet2CallbackImpl : public tools::i_wallet2_callback
}
}
- virtual void on_money_spent(uint64_t height, const cryptonote::transaction& in_tx, uint64_t amount,
+ virtual void on_money_spent(uint64_t height, const crypto::hash &txid, uint64_t amount,
const cryptonote::transaction& spend_tx)
{
// TODO;
- std::string tx_hash = epee::string_tools::pod_to_hex(get_transaction_hash(spend_tx));
+ std::string tx_hash = epee::string_tools::pod_to_hex(txid);
LOG_PRINT_L3(__FUNCTION__ << ": money spent. height: " << height
<< ", tx: " << tx_hash
<< ", amount: " << print_money(amount));
@@ -144,7 +144,7 @@ struct Wallet2CallbackImpl : public tools::i_wallet2_callback
}
}
- virtual void on_skip_transaction(uint64_t height, const cryptonote::transaction& tx)
+ virtual void on_skip_transaction(uint64_t height, const crypto::hash &txid)
{
// TODO;
}
diff --git a/src/wallet/wallet2.cpp b/src/wallet/wallet2.cpp
index 3b987c7d6..888c158c5 100644
--- a/src/wallet/wallet2.cpp
+++ b/src/wallet/wallet2.cpp
@@ -1029,7 +1029,7 @@ void wallet2::process_new_transaction(const crypto::hash &txid, const cryptonote
payment.m_unlock_time = tx.unlock_time;
payment.m_timestamp = ts;
if (pool) {
- m_unconfirmed_payments.emplace(txid(), payment);
+ m_unconfirmed_payments.emplace(txid, payment);
if (0 != m_callback)
m_callback->on_unconfirmed_money_received(height, txid, tx, payment.m_amount);
}