diff options
author | Riccardo Spagni <ric@spagni.net> | 2016-11-09 14:10:12 +0200 |
---|---|---|
committer | Riccardo Spagni <ric@spagni.net> | 2016-11-09 14:10:12 +0200 |
commit | 06ca304b062e739eb7c6177bb5eccaadd5bcd4c1 (patch) | |
tree | a1445616b29cf5fd787fd3dbdc300417363903e1 | |
parent | Merge pull request #1305 (diff) | |
parent | wallet_api: PendingTransaction::txCount - number of split transactions (diff) | |
download | monero-06ca304b062e739eb7c6177bb5eccaadd5bcd4c1.tar.xz |
Merge pull request #1307
4dcb74f wallet_api: PendingTransaction::txCount - number of split transactions (Ilya Kitaev)
-rw-r--r-- | src/wallet/api/pending_transaction.cpp | 9 | ||||
-rw-r--r-- | src/wallet/api/pending_transaction.h | 1 | ||||
-rw-r--r-- | src/wallet/wallet2_api.h | 5 |
3 files changed, 13 insertions, 2 deletions
diff --git a/src/wallet/api/pending_transaction.cpp b/src/wallet/api/pending_transaction.cpp index 80fb0b9a4..2521decea 100644 --- a/src/wallet/api/pending_transaction.cpp +++ b/src/wallet/api/pending_transaction.cpp @@ -80,8 +80,8 @@ std::vector<std::string> PendingTransactionImpl::txid() const bool PendingTransactionImpl::commit() { - LOG_PRINT_L0("m_pending_tx size: " << m_pending_tx.size()); - assert(m_pending_tx.size() == 1); + LOG_PRINT_L3("m_pending_tx size: " << m_pending_tx.size()); + try { while (!m_pending_tx.empty()) { auto & ptx = m_pending_tx.back(); @@ -142,5 +142,10 @@ uint64_t PendingTransactionImpl::fee() const return result; } +uint64_t PendingTransactionImpl::txCount() const +{ + return m_pending_tx.size(); +} + } diff --git a/src/wallet/api/pending_transaction.h b/src/wallet/api/pending_transaction.h index 2f06d2f6e..c5e847c97 100644 --- a/src/wallet/api/pending_transaction.h +++ b/src/wallet/api/pending_transaction.h @@ -50,6 +50,7 @@ public: uint64_t dust() const; uint64_t fee() const; std::vector<std::string> txid() const; + uint64_t txCount() const; // TODO: continue with interface; private: diff --git a/src/wallet/wallet2_api.h b/src/wallet/wallet2_api.h index da1dbd6e1..0aa36eafe 100644 --- a/src/wallet/wallet2_api.h +++ b/src/wallet/wallet2_api.h @@ -66,6 +66,11 @@ struct PendingTransaction virtual uint64_t dust() const = 0; virtual uint64_t fee() const = 0; virtual std::vector<std::string> txid() const = 0; + /*! + * \brief txCount - number of transactions current transaction will be splitted to + * \return + */ + virtual uint64_t txCount() const = 0; }; /** |