From 39ecd43321ef87be3f08bbc932188fc4c8ab9c8f Mon Sep 17 00:00:00 2001 From: cryptozoidberg Date: Sun, 8 Mar 2020 20:30:16 +0100 Subject: [PATCH] added expiration median to COMMAND_RPC_GET_TX_POOL --- src/rpc/core_rpc_server.cpp | 4 ++++ src/rpc/core_rpc_server_commands_defs.h | 2 ++ src/wallet/wallet2.cpp | 2 +- 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/rpc/core_rpc_server.cpp b/src/rpc/core_rpc_server.cpp index dc00ae0c..005f68f1 100644 --- a/src/rpc/core_rpc_server.cpp +++ b/src/rpc/core_rpc_server.cpp @@ -386,6 +386,9 @@ namespace currency return true; } + res.tx_expiration_ts_median = m_core.get_blockchain_storage().get_tx_expiration_median(); + + for(auto& tx: txs) { res.txs.push_back(t_serializable_object_to_blob(tx)); @@ -393,6 +396,7 @@ namespace currency res.status = CORE_RPC_STATUS_OK; return true; } + //------------------------------------------------------------------------------------------------------------------------------ bool core_rpc_server::on_scan_pos(const COMMAND_RPC_SCAN_POS::request& req, COMMAND_RPC_SCAN_POS::response& res, connection_context& cntx) { CHECK_CORE_READY(); diff --git a/src/rpc/core_rpc_server_commands_defs.h b/src/rpc/core_rpc_server_commands_defs.h index c0cb4990..c07a048c 100644 --- a/src/rpc/core_rpc_server_commands_defs.h +++ b/src/rpc/core_rpc_server_commands_defs.h @@ -181,10 +181,12 @@ namespace currency struct response { std::list txs; //transactions blobs + uint64_t tx_expiration_ts_median; std::string status; BEGIN_KV_SERIALIZE_MAP() KV_SERIALIZE(txs) + KV_SERIALIZE(tx_expiration_ts_median) KV_SERIALIZE(status) END_KV_SERIALIZE_MAP() }; diff --git a/src/wallet/wallet2.cpp b/src/wallet/wallet2.cpp index 229181dd..8bcbee8f 100644 --- a/src/wallet/wallet2.cpp +++ b/src/wallet/wallet2.cpp @@ -1356,7 +1356,7 @@ void wallet2::scan_tx_pool(bool& has_related_alias_in_unconfirmed) std::unordered_map> unconfirmed_multisig_transfers_from_tx_pool; has_related_alias_in_unconfirmed = false; - uint64_t tx_expiration_ts_median = get_tx_expiration_median(); + uint64_t tx_expiration_ts_median = res.tx_expiration_ts_median; //get_tx_expiration_median(); for (const auto &tx_blob : res.txs) { currency::transaction tx;