diff options
author | moneromooo-monero <moneromooo-monero@users.noreply.github.com> | 2015-11-22 12:26:27 +0000 |
---|---|---|
committer | moneromooo-monero <moneromooo-monero@users.noreply.github.com> | 2015-11-22 12:26:27 +0000 |
commit | 9156ba3a3cf26a9dc3e320c06c2e7c45652052cf (patch) | |
tree | bd2e16fa06a4f0dc9f92ddf2867acc431b6eb6f4 /src/wallet | |
parent | wallet: improve show_transfers (diff) | |
download | monero-9156ba3a3cf26a9dc3e320c06c2e7c45652052cf.tar.xz |
wallet: rename store-tx-keys to store-tx-info
With backward compatibility
Diffstat (limited to 'src/wallet')
-rw-r--r-- | src/wallet/wallet2.cpp | 13 | ||||
-rw-r--r-- | src/wallet/wallet2.h | 10 |
2 files changed, 12 insertions, 11 deletions
diff --git a/src/wallet/wallet2.cpp b/src/wallet/wallet2.cpp index d4c55b3aa..f26809af8 100644 --- a/src/wallet/wallet2.cpp +++ b/src/wallet/wallet2.cpp @@ -295,7 +295,7 @@ void wallet2::process_unconfirmed(const cryptonote::transaction& tx, uint64_t he crypto::hash txid = get_transaction_hash(tx); auto unconf_it = m_unconfirmed_txs.find(txid); if(unconf_it != m_unconfirmed_txs.end()) { - if (store_tx_keys()) { + if (store_tx_info()) { try { m_confirmed_txs.insert(std::make_pair(txid, confirmed_transfer_details(unconf_it->second, height))); } @@ -570,8 +570,8 @@ bool wallet2::store_keys(const std::string& keys_file_name, const std::string& p value2.SetInt(m_always_confirm_transfers ? 1 :0); json.AddMember("always_confirm_transfers", value2, json.GetAllocator()); - value2.SetInt(m_store_tx_keys ? 1 :0); - json.AddMember("store_tx_keys", value2, json.GetAllocator()); + value2.SetInt(m_store_tx_info ? 1 :0); + json.AddMember("store_tx_info", value2, json.GetAllocator()); value2.SetUint(m_default_mixin); json.AddMember("default_mixin", value2, json.GetAllocator()); @@ -657,7 +657,8 @@ void wallet2::load_keys(const std::string& keys_file_name, const std::string& pa m_watch_only = false; } m_always_confirm_transfers = json.HasMember("always_confirm_transfers") && (json["always_confirm_transfers"].GetInt() != 0); - m_store_tx_keys = json.HasMember("store_tx_keys") && (json["store_tx_keys"].GetInt() != 0); + m_store_tx_info = (json.HasMember("store_tx_keys") && (json["store_tx_keys"].GetInt() != 0)) + || (json.HasMember("store_tx_info") && (json["store_tx_info"].GetInt() != 0)); m_default_mixin = json.HasMember("default_mixin") ? json["default_mixin"].GetUint() : 0; } @@ -1408,13 +1409,13 @@ void wallet2::commit_tx(pending_tx& ptx) txid = get_transaction_hash(ptx.tx); crypto::hash payment_id = cryptonote::null_hash; std::vector<cryptonote::tx_destination_entry> dests; - if (store_tx_keys()) + if (store_tx_info()) { payment_id = get_payment_id(ptx); dests = ptx.dests; } add_unconfirmed_tx(ptx.tx, dests, payment_id, ptx.change_dts.amount); - if (store_tx_keys()) + if (store_tx_info()) m_tx_keys.insert(std::make_pair(txid, ptx.tx_key)); LOG_PRINT_L2("transaction " << txid << " generated ok and sent to daemon, key_images: [" << ptx.key_images << "]"); diff --git a/src/wallet/wallet2.h b/src/wallet/wallet2.h index 803312eea..27ecd3c14 100644 --- a/src/wallet/wallet2.h +++ b/src/wallet/wallet2.h @@ -79,9 +79,9 @@ namespace tools class wallet2 { - wallet2(const wallet2&) : m_run(true), m_callback(0), m_testnet(false), m_always_confirm_transfers (false), m_store_tx_keys(false), m_default_mixin(0) {} + wallet2(const wallet2&) : m_run(true), m_callback(0), m_testnet(false), m_always_confirm_transfers (false), m_store_tx_info(false), m_default_mixin(0) {} 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), m_store_tx_keys(false), m_default_mixin(0) {} + 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_info(false), m_default_mixin(0) {} struct transfer_details { uint64_t m_block_height; @@ -314,8 +314,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 store_tx_info() const { return m_store_tx_info; } + void store_tx_info(bool store) { m_store_tx_info = store; } uint32_t default_mixin() const { return m_default_mixin; } void default_mixin(uint32_t m) { m_default_mixin = m; } @@ -380,7 +380,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 */ + bool m_store_tx_info; /*!< request txkey to be returned in RPC, and store in the wallet cache file */ uint32_t m_default_mixin; }; } |