From 6041e12be8f37c6047d97e484fa1466291e25d17 Mon Sep 17 00:00:00 2001 From: woodser Date: Thu, 21 Nov 2019 12:02:03 -0500 Subject: [PATCH] set monero_tx_wallet.m_is_unlocked in monero_wallet --- src/wallet/monero_wallet.cpp | 4 ++++ src/wallet/monero_wallet_model.h | 1 + 2 files changed, 5 insertions(+) diff --git a/src/wallet/monero_wallet.cpp b/src/wallet/monero_wallet.cpp index 91a223f..b69308b 100644 --- a/src/wallet/monero_wallet.cpp +++ b/src/wallet/monero_wallet.cpp @@ -102,6 +102,7 @@ namespace monero { if (tx->m_payment_id->substr(16).find_first_not_of('0') == std::string::npos) tx->m_payment_id = tx->m_payment_id->substr(0, 16); // TODO monero core: this should be part of core wallet if (tx->m_payment_id == monero_tx::DEFAULT_PAYMENT_ID) tx->m_payment_id = boost::none; // clear default payment id tx->m_unlock_time = pd.m_unlock_time; + tx->m_is_unlocked = m_w2.is_transfer_unlocked(pd.m_unlock_time, pd.m_block_height); tx->m_fee = pd.m_fee; tx->m_note = m_w2.get_tx_note(pd.m_tx_hash); if (tx->m_note->empty()) tx->m_note = boost::none; // clear empty note @@ -153,6 +154,7 @@ namespace monero { if (tx->m_payment_id->substr(16).find_first_not_of('0') == std::string::npos) tx->m_payment_id = tx->m_payment_id->substr(0, 16); // TODO monero core: this should be part of core wallet if (tx->m_payment_id == monero_tx::DEFAULT_PAYMENT_ID) tx->m_payment_id = boost::none; // clear default payment id tx->m_unlock_time = pd.m_unlock_time; + tx->m_is_unlocked = m_w2.is_transfer_unlocked(pd.m_unlock_time, pd.m_block_height); tx->m_fee = pd.m_amount_in - pd.m_amount_out; tx->m_note = m_w2.get_tx_note(txid); if (tx->m_note->empty()) tx->m_note = boost::none; // clear empty note @@ -219,6 +221,7 @@ namespace monero { if (tx->m_payment_id->substr(16).find_first_not_of('0') == std::string::npos) tx->m_payment_id = tx->m_payment_id->substr(0, 16); // TODO monero core: this should be part of core wallet if (tx->m_payment_id == monero_tx::DEFAULT_PAYMENT_ID) tx->m_payment_id = boost::none; // clear default payment id tx->m_unlock_time = pd.m_unlock_time; + tx->m_is_unlocked = false; tx->m_fee = pd.m_fee; tx->m_note = m_w2.get_tx_note(pd.m_tx_hash); if (tx->m_note->empty()) tx->m_note = boost::none; // clear empty note @@ -259,6 +262,7 @@ namespace monero { if (tx->m_payment_id->substr(16).find_first_not_of('0') == std::string::npos) tx->m_payment_id = tx->m_payment_id->substr(0, 16); // TODO monero core: this should be part of core wallet if (tx->m_payment_id == monero_tx::DEFAULT_PAYMENT_ID) tx->m_payment_id = boost::none; // clear default payment id tx->m_unlock_time = pd.m_tx.unlock_time; + tx->m_is_unlocked = false; tx->m_fee = pd.m_amount_in - pd.m_amount_out; tx->m_note = m_w2.get_tx_note(txid); if (tx->m_note->empty()) tx->m_note = boost::none; // clear empty note diff --git a/src/wallet/monero_wallet_model.h b/src/wallet/monero_wallet_model.h index 3b473ba..0446524 100644 --- a/src/wallet/monero_wallet_model.h +++ b/src/wallet/monero_wallet_model.h @@ -261,6 +261,7 @@ namespace monero { vector> m_incoming_transfers; boost::optional> m_outgoing_transfer; boost::optional m_note; + boost::optional m_is_unlocked; shared_ptr copy(const shared_ptr& src, const shared_ptr& tgt) const; shared_ptr copy(const shared_ptr& src, const shared_ptr& tgt) const;