aboutsummaryrefslogtreecommitdiff
path: root/src/wallet/wallet2.h
diff options
context:
space:
mode:
authormoneromooo-monero <moneromooo-monero@users.noreply.github.com>2015-08-19 20:59:44 +0100
committermoneromooo-monero <moneromooo-monero@users.noreply.github.com>2015-08-24 17:36:44 +0100
commitd91eb8c7b43fc73b9333de800500f217e370cc4b (patch)
tree01efcc9a510c0878daaff8f32b01b47e1a3e5acb /src/wallet/wallet2.h
parentMerge pull request #385 (diff)
downloadmonero-d91eb8c7b43fc73b9333de800500f217e370cc4b.tar.xz
wallet: only return tx keys via RPC if requested
To get the tx keys returned via RPC, set the "get_tx_key" or "get_tx_keys" request field to true (defaults to false).
Diffstat (limited to 'src/wallet/wallet2.h')
-rw-r--r--src/wallet/wallet2.h9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/wallet/wallet2.h b/src/wallet/wallet2.h
index b04a920ce..b086f7ee8 100644
--- a/src/wallet/wallet2.h
+++ b/src/wallet/wallet2.h
@@ -80,9 +80,9 @@ namespace tools
class wallet2
{
- wallet2(const wallet2&) : m_run(true), m_callback(0), m_testnet(false), m_always_confirm_transfers (false) {};
+ wallet2(const wallet2&) : m_run(true), m_callback(0), m_testnet(false), m_always_confirm_transfers (false), m_store_tx_keys(false) {};
public:
- wallet2(bool testnet = false, bool restricted = false) : m_run(true), m_callback(0), m_testnet(testnet), m_restricted(restricted), is_old_file_format(false) {};
+ wallet2(bool testnet = false, bool restricted = false) : m_run(true), m_callback(0), m_testnet(testnet), m_restricted(restricted), is_old_file_format(false), m_store_tx_keys(false) {};
struct transfer_details
{
uint64_t m_block_height;
@@ -292,6 +292,8 @@ namespace tools
bool always_confirm_transfers() const { return m_always_confirm_transfers; }
void always_confirm_transfers(bool always) { m_always_confirm_transfers = always; }
+ bool store_tx_keys() const { return m_store_tx_keys; }
+ void store_tx_keys(bool store) { m_store_tx_keys = store; }
bool get_tx_key(const crypto::hash &txid, crypto::secret_key &tx_key) const;
@@ -351,6 +353,7 @@ namespace tools
bool is_old_file_format; /*!< Whether the wallet file is of an old file format */
bool m_watch_only; /*!< no spend key */
bool m_always_confirm_transfers;
+ bool m_store_tx_keys; /*!< request txkey to be returned in RPC, and store in the wallet cache file */
};
}
BOOST_CLASS_VERSION(tools::wallet2, 8)
@@ -585,7 +588,7 @@ namespace tools
}
crypto::secret_key tx_key;
- bool r = cryptonote::construct_tx(m_account.get_keys(), sources, splitted_dsts, extra, tx, unlock_time, tx_key);
+ bool r = cryptonote::construct_tx_and_get_tx_key(m_account.get_keys(), sources, splitted_dsts, extra, tx, unlock_time, tx_key);
THROW_WALLET_EXCEPTION_IF(!r, error::tx_not_constructed, sources, splitted_dsts, unlock_time, m_testnet);
THROW_WALLET_EXCEPTION_IF(m_upper_transaction_size_limit <= get_object_blobsize(tx), error::tx_too_big, tx, m_upper_transaction_size_limit);