From 293ad48d63d5e037ec2963aa87bbd6b71e3e0124 Mon Sep 17 00:00:00 2001 From: woodser Date: Thu, 21 Nov 2019 16:01:21 -0500 Subject: [PATCH] support is_unlocked in tx_query meets_criteria, node_to_tx_wallet, copy --- src/utils/monero_utils.cpp | 10 ++++++---- src/wallet/monero_wallet_model.cpp | 2 ++ 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/utils/monero_utils.cpp b/src/utils/monero_utils.cpp index b1fc298..ac16b8b 100644 --- a/src/utils/monero_utils.cpp +++ b/src/utils/monero_utils.cpp @@ -198,6 +198,8 @@ void node_to_tx_wallet(const boost::property_tree::ptree& node, shared_ptrfirst; //if (key == string("id")) tx->m_id = it->second.data(); + if (key == string("isUnlocked")) tx_wallet->m_is_unlocked = it->second.get_value(); + // TODO: deserialize other fields } } @@ -224,7 +226,7 @@ shared_ptr node_to_tx_query(const boost::property_tree::ptree& return m_tx_query; } -shared_ptr node_to_blockquery(const boost::property_tree::ptree& node) { +shared_ptr node_to_block_query(const boost::property_tree::ptree& node) { shared_ptr block = make_shared(); for (boost::property_tree::ptree::const_iterator it = node.begin(); it != node.end(); ++it) { string key = it->first; @@ -322,7 +324,7 @@ shared_ptr monero_utils::deserialize_tx_query(const string& tx_ boost::property_tree::read_json(iss, block_node); // convert query property tree to block - shared_ptr block = node_to_blockquery(block_node); + shared_ptr block = node_to_block_query(block_node); // get tx query shared_ptr tx_query = static_pointer_cast(block->m_txs[0]); @@ -339,7 +341,7 @@ shared_ptr monero_utils::deserialize_transfer_query(const boost::property_tree::read_json(iss, blockNode); // convert query property tree to block - shared_ptr block = node_to_blockquery(blockNode); + shared_ptr block = node_to_block_query(blockNode); // return mpty query if no txs if (block->m_txs.empty()) return make_shared(); @@ -366,7 +368,7 @@ shared_ptr monero_utils::deserialize_output_query(const str boost::property_tree::read_json(iss, blockNode); // convert query property tree to block - shared_ptr block = node_to_blockquery(blockNode); + shared_ptr block = node_to_block_query(blockNode); // empty query if no txs if (block->m_txs.empty()) return make_shared(); diff --git a/src/wallet/monero_wallet_model.cpp b/src/wallet/monero_wallet_model.cpp index 5852791..69f89d5 100644 --- a/src/wallet/monero_wallet_model.cpp +++ b/src/wallet/monero_wallet_model.cpp @@ -133,6 +133,7 @@ namespace monero { tgt->m_outgoing_transfer = transferCopy; } tgt->m_note = src->m_note; + tgt->m_is_unlocked = src->m_is_unlocked; return tgt; }; @@ -242,6 +243,7 @@ namespace monero { if (m_do_not_relay != boost::none && m_do_not_relay != tx->m_do_not_relay) return false; if (m_is_failed != boost::none && m_is_failed != tx->m_is_failed) return false; if (m_is_miner_tx != boost::none && m_is_miner_tx != tx->m_is_miner_tx) return false; + if (m_is_unlocked != boost::none && m_is_unlocked != tx->m_is_unlocked) return false; // at least one transfer must meet transfer query if defined if (m_transfer_query != boost::none) {