aboutsummaryrefslogtreecommitdiff
path: root/src/wallet
diff options
context:
space:
mode:
authormoneromooo-monero <moneromooo-monero@users.noreply.github.com>2016-10-01 17:03:53 +0100
committermoneromooo-monero <moneromooo-monero@users.noreply.github.com>2016-10-01 17:03:53 +0100
commit80b4da3330eeb09f0631fd5897f85309a18f3f3b (patch)
tree73065679e398b7c1dea141939cb04b998cd9770c /src/wallet
parentMerge pull request #1124 (diff)
downloadmonero-80b4da3330eeb09f0631fd5897f85309a18f3f3b.tar.xz
wallet: wallet option to confirm transfers with no payment id
set confirm-missing-payment-id 0|1 Defaults to true.
Diffstat (limited to 'src/wallet')
-rw-r--r--src/wallet/wallet2.cpp6
-rw-r--r--src/wallet/wallet2.h7
2 files changed, 11 insertions, 2 deletions
diff --git a/src/wallet/wallet2.cpp b/src/wallet/wallet2.cpp
index ed4ab93de..22ab4ec8e 100644
--- a/src/wallet/wallet2.cpp
+++ b/src/wallet/wallet2.cpp
@@ -1413,6 +1413,9 @@ bool wallet2::store_keys(const std::string& keys_file_name, const std::string& p
value2.SetUint64(m_refresh_from_block_height);
json.AddMember("refresh_height", value2, json.GetAllocator());
+ value2.SetInt(m_confirm_missing_payment_id ? 1 :0);
+ json.AddMember("confirm_missing_payment_id", value2, json.GetAllocator());
+
// Serialize the JSON object
rapidjson::StringBuffer buffer;
rapidjson::Writer<rapidjson::StringBuffer> writer(buffer);
@@ -1478,6 +1481,7 @@ bool wallet2::load_keys(const std::string& keys_file_name, const std::string& pa
m_default_priority = 0;
m_auto_refresh = true;
m_refresh_type = RefreshType::RefreshDefault;
+ m_confirm_missing_payment_id = true;
}
else
{
@@ -1535,6 +1539,8 @@ bool wallet2::load_keys(const std::string& keys_file_name, const std::string& pa
GET_FIELD_FROM_JSON_RETURN_ON_ERROR(json, refresh_height, uint64_t, Uint64, false, 0);
if (field_refresh_height_found)
m_refresh_from_block_height = field_refresh_height;
+ GET_FIELD_FROM_JSON_RETURN_ON_ERROR(json, confirm_missing_payment_id, int, Int, false, false);
+ m_confirm_missing_payment_id = !field_confirm_missing_payment_id_found || field_confirm_missing_payment_id;
}
const cryptonote::account_keys& keys = m_account.get_keys();
diff --git a/src/wallet/wallet2.h b/src/wallet/wallet2.h
index dd7cd19dc..f50a437bd 100644
--- a/src/wallet/wallet2.h
+++ b/src/wallet/wallet2.h
@@ -92,10 +92,10 @@ namespace tools
};
private:
- wallet2(const wallet2&) : m_run(true), m_callback(0), m_testnet(false), m_always_confirm_transfers (false), m_store_tx_info(true), m_default_mixin(0), m_default_priority(0), m_refresh_type(RefreshOptimizeCoinbase), m_auto_refresh(true), m_refresh_from_block_height(0) {}
+ wallet2(const wallet2&) : m_run(true), m_callback(0), m_testnet(false), m_always_confirm_transfers (false), m_store_tx_info(true), m_default_mixin(0), m_default_priority(0), m_refresh_type(RefreshOptimizeCoinbase), m_auto_refresh(true), m_refresh_from_block_height(0), m_confirm_missing_payment_id(true) {}
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_info(true), m_default_mixin(0), m_default_priority(0), m_refresh_type(RefreshOptimizeCoinbase), m_auto_refresh(true), m_refresh_from_block_height(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(true), m_default_mixin(0), m_default_priority(0), m_refresh_type(RefreshOptimizeCoinbase), m_auto_refresh(true), m_refresh_from_block_height(0), m_confirm_missing_payment_id(true) {}
struct transfer_details
{
uint64_t m_block_height;
@@ -389,6 +389,8 @@ namespace tools
void set_default_priority(uint32_t p) { m_default_priority = p; }
bool auto_refresh() const { return m_auto_refresh; }
void auto_refresh(bool r) { m_auto_refresh = r; }
+ bool confirm_missing_payment_id() const { return m_confirm_missing_payment_id; }
+ void confirm_missing_payment_id(bool always) { m_confirm_missing_payment_id = always; }
bool get_tx_key(const crypto::hash &txid, crypto::secret_key &tx_key) const;
@@ -503,6 +505,7 @@ namespace tools
RefreshType m_refresh_type;
bool m_auto_refresh;
uint64_t m_refresh_from_block_height;
+ bool m_confirm_missing_payment_id;
};
}
BOOST_CLASS_VERSION(tools::wallet2, 14)