mirror of
https://github.com/monero-project/monero.git
synced 2025-05-25 16:10:55 -04:00
wallet: add boolean to always confirm transactions with the user
This can be useful if you want to be given a veto over the tx fee, or if you want to see what a tx fee would be without actually sending.
This commit is contained in:
parent
7ef8e5c033
commit
8fe180ab80
4 changed files with 82 additions and 6 deletions
|
@ -502,6 +502,9 @@ bool wallet2::store_keys(const std::string& keys_file_name, const std::string& p
|
|||
value2.SetInt(watch_only ? 1 :0); // WTF ? JSON has different true and false types, and not boolean ??
|
||||
json.AddMember("watch_only", value2, json.GetAllocator());
|
||||
|
||||
value2.SetInt(m_always_confirm_transfers ? 1 :0);
|
||||
json.AddMember("always_confirm_transfers", value2, json.GetAllocator());
|
||||
|
||||
// Serialize the JSON object
|
||||
rapidjson::StringBuffer buffer;
|
||||
rapidjson::Writer<rapidjson::StringBuffer> writer(buffer);
|
||||
|
@ -562,6 +565,7 @@ void wallet2::load_keys(const std::string& keys_file_name, const std::string& pa
|
|||
{
|
||||
is_old_file_format = true;
|
||||
m_watch_only = false;
|
||||
m_always_confirm_transfers = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -580,6 +584,7 @@ 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);
|
||||
}
|
||||
|
||||
const cryptonote::account_keys& keys = m_account.get_keys();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue