replace output is_locked with tx wallet is_locked

This commit is contained in:
woodser
2019-11-29 11:23:10 -05:00
parent ef0fa66180
commit cad7a31567
4 changed files with 4 additions and 6 deletions
+3 -1
View File
@@ -117,6 +117,7 @@ void node_to_output(const boost::property_tree::ptree& node, shared_ptr<monero_o
else if (key == string("index")) output->m_index = it->second.get_value<uint32_t>();
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_ptr<m
if (key == string("accountIndex")) output_wallet->m_account_index = it->second.get_value<uint32_t>();
else if (key == string("subaddressIndex")) output_wallet->m_subaddress_index = it->second.get_value<uint32_t>();
else if (key == string("isSpent")) output_wallet->m_is_spent = it->second.get_value<bool>();
else if (key == string("isLocked")) output_wallet->m_is_locked = it->second.get_value<bool>();
else if (key == string("isFrozen")) output_wallet->m_is_frozen = it->second.get_value<bool>();
else cout << "WARNING: unrecognized field deserializing node to output wallet: " << key << endl;
}
}
@@ -141,6 +142,7 @@ shared_ptr<monero_output_query> 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<uint32_t>());
else if (key == string("txQuery")) {} // ignored
else cout << "WARNING: unrecognized field deserializing node to output query: " << key << endl;
}
return m_output_query;
-1
View File
@@ -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<monero_key_image>();
+1 -3
View File
@@ -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) {
-1
View File
@@ -221,7 +221,6 @@ namespace monero {
boost::optional<uint32_t> m_account_index;
boost::optional<uint32_t> m_subaddress_index;
boost::optional<bool> m_is_spent;
boost::optional<bool> m_is_locked;
boost::optional<bool> m_is_frozen;
shared_ptr<monero_output_wallet> copy(const shared_ptr<monero_output>& src, const shared_ptr<monero_output>& tgt) const;