aboutsummaryrefslogtreecommitdiff
path: root/src/wallet
diff options
context:
space:
mode:
authorJaquee <jaquee.monero@gmail.com>2017-08-03 21:37:45 +0200
committerJaquee <jaquee.monero@gmail.com>2017-08-03 21:37:45 +0200
commita839a6fa8a01ade5672d8205bc5a2632a9992fc2 (patch)
treef488b794b798502a4ffea9cbfd91d97d74089a81 /src/wallet
parentMerge pull request #2159 (diff)
downloadmonero-a839a6fa8a01ade5672d8205bc5a2632a9992fc2.tar.xz
Wallet API: add tx unlock time
Diffstat (limited to 'src/wallet')
-rw-r--r--src/wallet/api/transaction_history.cpp1
-rw-r--r--src/wallet/api/transaction_info.cpp6
-rw-r--r--src/wallet/api/transaction_info.h2
-rw-r--r--src/wallet/wallet2_api.h1
4 files changed, 10 insertions, 0 deletions
diff --git a/src/wallet/api/transaction_history.cpp b/src/wallet/api/transaction_history.cpp
index 85f2b05ce..23d3905b2 100644
--- a/src/wallet/api/transaction_history.cpp
+++ b/src/wallet/api/transaction_history.cpp
@@ -132,6 +132,7 @@ void TransactionHistoryImpl::refresh()
ti->m_blockheight = pd.m_block_height;
ti->m_timestamp = pd.m_timestamp;
ti->m_confirmations = wallet_height - pd.m_block_height;
+ ti->m_unlock_time = pd.m_unlock_time;
m_history.push_back(ti);
/* output.insert(std::make_pair(pd.m_block_height, std::make_pair(true, (boost::format("%20.20s %s %s %s")
diff --git a/src/wallet/api/transaction_info.cpp b/src/wallet/api/transaction_info.cpp
index 79a8fe9b5..171272265 100644
--- a/src/wallet/api/transaction_info.cpp
+++ b/src/wallet/api/transaction_info.cpp
@@ -50,6 +50,7 @@ TransactionInfoImpl::TransactionInfoImpl()
, m_blockheight(0)
, m_timestamp(0)
, m_confirmations(0)
+ , m_unlock_time(0)
{
}
@@ -115,6 +116,11 @@ uint64_t TransactionInfoImpl::confirmations() const
return m_confirmations;
}
+uint64_t TransactionInfoImpl::unlockTime() const
+{
+ return m_unlock_time;
+}
+
} // namespace
namespace Bitmonero = Monero;
diff --git a/src/wallet/api/transaction_info.h b/src/wallet/api/transaction_info.h
index 16fa5da7a..ee56b859f 100644
--- a/src/wallet/api/transaction_info.h
+++ b/src/wallet/api/transaction_info.h
@@ -56,6 +56,7 @@ public:
virtual std::string paymentId() const;
virtual const std::vector<Transfer> &transfers() const;
virtual uint64_t confirmations() const;
+ virtual uint64_t unlockTime() const;
private:
int m_direction;
@@ -69,6 +70,7 @@ private:
std::string m_paymentid;
std::vector<Transfer> m_transfers;
uint64_t m_confirmations;
+ uint64_t m_unlock_time;
friend class TransactionHistoryImpl;
diff --git a/src/wallet/wallet2_api.h b/src/wallet/wallet2_api.h
index a136954f0..fd8c50b82 100644
--- a/src/wallet/wallet2_api.h
+++ b/src/wallet/wallet2_api.h
@@ -156,6 +156,7 @@ struct TransactionInfo
virtual uint64_t fee() const = 0;
virtual uint64_t blockHeight() const = 0;
virtual uint64_t confirmations() const = 0;
+ virtual uint64_t unlockTime() const = 0;
//! transaction_id
virtual std::string hash() const = 0;
virtual std::time_t timestamp() const = 0;