mirror of
https://codeberg.org/anoncontributorxmr/monero.git
synced 2024-11-23 07:52:25 +00:00
rpc: add relayed in get_transaction output
This commit is contained in:
parent
82e510f15e
commit
565085245a
2 changed files with 11 additions and 5 deletions
|
@ -574,7 +574,7 @@ namespace cryptonote
|
||||||
// try the pool for any missing txes
|
// try the pool for any missing txes
|
||||||
size_t found_in_pool = 0;
|
size_t found_in_pool = 0;
|
||||||
std::unordered_set<crypto::hash> pool_tx_hashes;
|
std::unordered_set<crypto::hash> pool_tx_hashes;
|
||||||
std::unordered_map<crypto::hash, bool> double_spend_seen;
|
std::unordered_map<crypto::hash, tx_info> per_tx_pool_tx_info;
|
||||||
if (!missed_txs.empty())
|
if (!missed_txs.empty())
|
||||||
{
|
{
|
||||||
std::vector<tx_info> pool_tx_info;
|
std::vector<tx_info> pool_tx_info;
|
||||||
|
@ -629,7 +629,7 @@ namespace cryptonote
|
||||||
{
|
{
|
||||||
if (ti.id_hash == hash_string)
|
if (ti.id_hash == hash_string)
|
||||||
{
|
{
|
||||||
double_spend_seen.insert(std::make_pair(h, ti.double_spend_seen));
|
per_tx_pool_tx_info.insert(std::make_pair(h, ti));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -715,14 +715,17 @@ namespace cryptonote
|
||||||
if (e.in_pool)
|
if (e.in_pool)
|
||||||
{
|
{
|
||||||
e.block_height = e.block_timestamp = std::numeric_limits<uint64_t>::max();
|
e.block_height = e.block_timestamp = std::numeric_limits<uint64_t>::max();
|
||||||
if (double_spend_seen.find(tx_hash) != double_spend_seen.end())
|
auto it = per_tx_pool_tx_info.find(tx_hash);
|
||||||
|
if (it != per_tx_pool_tx_info.end())
|
||||||
{
|
{
|
||||||
e.double_spend_seen = double_spend_seen[tx_hash];
|
e.double_spend_seen = it->second.double_spend_seen;
|
||||||
|
e.relayed = it->second.relayed;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
MERROR("Failed to determine double spend status for " << tx_hash);
|
MERROR("Failed to determine pool info for " << tx_hash);
|
||||||
e.double_spend_seen = false;
|
e.double_spend_seen = false;
|
||||||
|
e.relayed = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -730,6 +733,7 @@ namespace cryptonote
|
||||||
e.block_height = m_core.get_blockchain_storage().get_db().get_tx_block_height(tx_hash);
|
e.block_height = m_core.get_blockchain_storage().get_db().get_tx_block_height(tx_hash);
|
||||||
e.block_timestamp = m_core.get_blockchain_storage().get_db().get_block_timestamp(e.block_height);
|
e.block_timestamp = m_core.get_blockchain_storage().get_db().get_block_timestamp(e.block_height);
|
||||||
e.double_spend_seen = false;
|
e.double_spend_seen = false;
|
||||||
|
e.relayed = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// fill up old style responses too, in case an old wallet asks
|
// fill up old style responses too, in case an old wallet asks
|
||||||
|
|
|
@ -364,6 +364,7 @@ namespace cryptonote
|
||||||
uint64_t block_height;
|
uint64_t block_height;
|
||||||
uint64_t block_timestamp;
|
uint64_t block_timestamp;
|
||||||
std::vector<uint64_t> output_indices;
|
std::vector<uint64_t> output_indices;
|
||||||
|
bool relayed;
|
||||||
|
|
||||||
BEGIN_KV_SERIALIZE_MAP()
|
BEGIN_KV_SERIALIZE_MAP()
|
||||||
KV_SERIALIZE(tx_hash)
|
KV_SERIALIZE(tx_hash)
|
||||||
|
@ -377,6 +378,7 @@ namespace cryptonote
|
||||||
KV_SERIALIZE(block_height)
|
KV_SERIALIZE(block_height)
|
||||||
KV_SERIALIZE(block_timestamp)
|
KV_SERIALIZE(block_timestamp)
|
||||||
KV_SERIALIZE(output_indices)
|
KV_SERIALIZE(output_indices)
|
||||||
|
KV_SERIALIZE(relayed)
|
||||||
END_KV_SERIALIZE_MAP()
|
END_KV_SERIALIZE_MAP()
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue