From 4da111296717cf9978b5261f1774cbb41b412af6 Mon Sep 17 00:00:00 2001 From: moneromooo-monero Date: Thu, 15 Apr 2021 15:29:13 +0000 Subject: rpc: send confirmations in get_transactions result if the wallet does it, it would get a wrong result (possibly even negative) if its local chain is not synced up to the daemon's yet --- src/rpc/core_rpc_server.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/rpc/core_rpc_server.cpp') diff --git a/src/rpc/core_rpc_server.cpp b/src/rpc/core_rpc_server.cpp index 40c04b4f9..d6b2bda0c 100644 --- a/src/rpc/core_rpc_server.cpp +++ b/src/rpc/core_rpc_server.cpp @@ -1043,6 +1043,7 @@ namespace cryptonote if (e.in_pool) { e.block_height = e.block_timestamp = std::numeric_limits::max(); + e.confirmations = 0; auto it = per_tx_pool_tx_info.find(tx_hash); if (it != per_tx_pool_tx_info.end()) { @@ -1061,6 +1062,7 @@ namespace cryptonote else { e.block_height = m_core.get_blockchain_storage().get_db().get_tx_block_height(tx_hash); + e.confirmations = m_core.get_current_blockchain_height() - e.block_height; e.block_timestamp = m_core.get_blockchain_storage().get_db().get_block_timestamp(e.block_height); e.received_timestamp = 0; e.double_spend_seen = false; -- cgit v1.2.3