From cad7a3156716097cbbf47a6212070682b010793a Mon Sep 17 00:00:00 2001 From: woodser Date: Fri, 29 Nov 2019 11:23:10 -0500 Subject: [PATCH] replace output is_locked with tx wallet is_locked --- src/utils/monero_utils.cpp | 4 +++- src/wallet/monero_wallet.cpp | 1 - src/wallet/monero_wallet_model.cpp | 4 +--- src/wallet/monero_wallet_model.h | 1 - 4 files changed, 4 insertions(+), 6 deletions(-) diff --git a/src/utils/monero_utils.cpp b/src/utils/monero_utils.cpp index f33087b..a8d22d6 100644 --- a/src/utils/monero_utils.cpp +++ b/src/utils/monero_utils.cpp @@ -117,6 +117,7 @@ void node_to_output(const boost::property_tree::ptree& node, shared_ptrm_index = it->second.get_value(); else if (key == string("ringOutputIndices")) throw runtime_error("node_to_tx() deserialize ringOutputIndices not implemented"); else if (key == string("stealthPublicKey")) throw runtime_error("node_to_tx() deserialize stealthPublicKey not implemented"); + else cout << "WARNING: unrecognized field deserializing node to output: " << key << endl; } } @@ -127,8 +128,8 @@ void node_to_output_wallet(const boost::property_tree::ptree& node, shared_ptrm_account_index = it->second.get_value(); else if (key == string("subaddressIndex")) output_wallet->m_subaddress_index = it->second.get_value(); else if (key == string("isSpent")) output_wallet->m_is_spent = it->second.get_value(); - else if (key == string("isLocked")) output_wallet->m_is_locked = it->second.get_value(); else if (key == string("isFrozen")) output_wallet->m_is_frozen = it->second.get_value(); + else cout << "WARNING: unrecognized field deserializing node to output wallet: " << key << endl; } } @@ -141,6 +142,7 @@ shared_ptr node_to_output_query(const boost::property_tree: string key = it->first; if (key == string("subaddressIndices")) for (boost::property_tree::ptree::const_iterator it2 = it->second.begin(); it2 != it->second.end(); ++it2) m_output_query->m_subaddress_indices.push_back(it2->second.get_value()); else if (key == string("txQuery")) {} // ignored + else cout << "WARNING: unrecognized field deserializing node to output query: " << key << endl; } return m_output_query; diff --git a/src/wallet/monero_wallet.cpp b/src/wallet/monero_wallet.cpp index b2549f8..6548064 100644 --- a/src/wallet/monero_wallet.cpp +++ b/src/wallet/monero_wallet.cpp @@ -346,7 +346,6 @@ namespace monero { vout->m_account_index = td.m_subaddr_index.major; vout->m_subaddress_index = td.m_subaddr_index.minor; vout->m_is_spent = td.m_spent; - vout->m_is_locked = !m_w2.is_transfer_unlocked(td); // TODO: this is redundant with tx vout->m_is_frozen = td.m_frozen; if (td.m_key_image_known) { vout->m_key_image = make_shared(); diff --git a/src/wallet/monero_wallet_model.cpp b/src/wallet/monero_wallet_model.cpp index 7aa89e8..b60c461 100644 --- a/src/wallet/monero_wallet_model.cpp +++ b/src/wallet/monero_wallet_model.cpp @@ -582,7 +582,6 @@ namespace monero { tgt->m_account_index = src->m_account_index; tgt->m_subaddress_index = src->m_subaddress_index; tgt->m_is_spent = src->m_is_spent; - tgt->m_is_locked = src->m_is_locked; tgt->m_is_frozen = src->m_is_frozen; return tgt; }; @@ -592,7 +591,6 @@ namespace monero { if (m_account_index != boost::none) node.put("accountIndex", *m_account_index); if (m_subaddress_index != boost::none) node.put("subaddressIndex", *m_subaddress_index); if (m_is_spent != boost::none) node.put("isSpent", *m_is_spent); - if (m_is_locked != boost::none) node.put("isLocked", *m_is_locked); if (m_is_frozen != boost::none) node.put("isFrozen", *m_is_frozen); return node; } @@ -613,6 +611,7 @@ namespace monero { m_account_index = gen_utils::reconcile(m_account_index, other->m_account_index); m_subaddress_index = gen_utils::reconcile(m_subaddress_index, other->m_subaddress_index); m_is_spent = gen_utils::reconcile(m_is_spent, other->m_is_spent); + m_is_frozen = gen_utils::reconcile(m_is_frozen, other->m_is_frozen); } // ------------------------ MONERO OUTPUT REQUEST --------------------------- @@ -656,7 +655,6 @@ namespace monero { if (m_subaddress_index != boost::none && (output->m_subaddress_index == boost::none || *m_subaddress_index != *output->m_subaddress_index)) return false; if (m_amount != boost::none && (output->m_amount == boost::none || *m_amount != *output->m_amount)) return false; if (m_is_spent != boost::none && (output->m_is_spent == boost::none || *m_is_spent != *output->m_is_spent)) return false; - if (m_is_locked != boost::none && (output->m_is_locked == boost::none || *m_is_locked != *output->m_is_locked)) return false; // filter on output key image if (m_key_image != boost::none) { diff --git a/src/wallet/monero_wallet_model.h b/src/wallet/monero_wallet_model.h index 6626820..7152f4d 100644 --- a/src/wallet/monero_wallet_model.h +++ b/src/wallet/monero_wallet_model.h @@ -221,7 +221,6 @@ namespace monero { boost::optional m_account_index; boost::optional m_subaddress_index; boost::optional m_is_spent; - boost::optional m_is_locked; boost::optional m_is_frozen; shared_ptr copy(const shared_ptr& src, const shared_ptr& tgt) const;