diff --git a/src/wallet/wallet_rpc_server.cpp b/src/wallet/wallet_rpc_server.cpp index debe1300..ede30932 100644 --- a/src/wallet/wallet_rpc_server.cpp +++ b/src/wallet/wallet_rpc_server.cpp @@ -226,6 +226,13 @@ namespace tools m_wallet.get_payments(payment_id, payment_list); for (auto payment : payment_list) { + if (payment.m_unlock_time && !req.allow_locked_transactions) + { + //check that transaction don't have locking for time longer then 10 blocks ahead + //TODO: add code for "unlock_time" set as timestamp, now it's all being filtered + if (payment.m_unlock_time > payment.m_block_height + WALLET_DEFAULT_TX_SPENDABLE_AGE) + continue; + } wallet_rpc::payment_details rpc_payment; rpc_payment.payment_id = req.payment_id; rpc_payment.tx_hash = epee::string_tools::pod_to_hex(payment.m_tx_hash); @@ -257,6 +264,14 @@ namespace tools for (auto & payment : payment_list) { + if (payment.m_unlock_time && !req.allow_locked_transactions) + { + //check that transaction don't have locking for time longer then 10 blocks ahead + //TODO: add code for "unlock_time" set as timestamp, now it's all being filtered + if (payment.m_unlock_time > payment.m_block_height + WALLET_DEFAULT_TX_SPENDABLE_AGE) + continue; + } + wallet_rpc::payment_details rpc_payment; rpc_payment.payment_id = payment_id_str; rpc_payment.tx_hash = epee::string_tools::pod_to_hex(payment.m_tx_hash); diff --git a/src/wallet/wallet_rpc_server_commans_defs.h b/src/wallet/wallet_rpc_server_commans_defs.h index 2c4ef2ba..79beae2c 100644 --- a/src/wallet/wallet_rpc_server_commans_defs.h +++ b/src/wallet/wallet_rpc_server_commans_defs.h @@ -277,9 +277,11 @@ namespace wallet_rpc struct request { std::string payment_id; // hex-encoded + bool allow_locked_transactions; BEGIN_KV_SERIALIZE_MAP() KV_SERIALIZE(payment_id) + KV_SERIALIZE(allow_locked_transactions) END_KV_SERIALIZE_MAP() }; @@ -299,10 +301,12 @@ namespace wallet_rpc { std::vector payment_ids; uint64_t min_block_height; + bool allow_locked_transactions; BEGIN_KV_SERIALIZE_MAP() KV_SERIALIZE(payment_ids) KV_SERIALIZE(min_block_height) + KV_SERIALIZE(allow_locked_transactions) END_KV_SERIALIZE_MAP() }; diff --git a/utils/update_alert.json b/utils/update_alert.json index 572decfd..6766e765 100644 --- a/utils/update_alert.json +++ b/utils/update_alert.json @@ -5,7 +5,7 @@ "build":26, "cs":[ { - "build":27, + "build":28, "mode":3 } ]