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
This commit is contained in:
moneromooo-monero 2021-04-15 15:29:13 +00:00
parent f6279a633d
commit 4da1112967
No known key found for this signature in database
GPG key ID: 686F07454D6CEFC3
3 changed files with 19 additions and 5 deletions

View file

@ -1043,6 +1043,7 @@ namespace cryptonote
if (e.in_pool)
{
e.block_height = e.block_timestamp = std::numeric_limits<uint64_t>::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;