Skip to content

Commit

Permalink
rpc: do not include output indices for pool txes
Browse files Browse the repository at this point in the history
Those aren't yet in the blockchain, so will not be found
(and aren't yet known, since it depends on where exactly the
tx will be mined in the next block or blocks)
  • Loading branch information
moneromooo-monero committed Nov 23, 2016
1 parent e227d6e commit 1d9e223
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions src/rpc/core_rpc_server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -425,12 +425,15 @@ namespace cryptonote
if (req.decode_as_json)
res.txs_as_json.push_back(e.as_json);

// output indices too
bool r = m_core.get_tx_outputs_gindexs(tx_hash, e.output_indices);
if (!r)
// output indices too if not in pool
if (pool_tx_hashes.find(tx_hash) == pool_tx_hashes.end())
{
res.status = "Failed";
return false;
bool r = m_core.get_tx_outputs_gindexs(tx_hash, e.output_indices);
if (!r)
{
res.status = "Failed";
return false;
}
}
}

Expand Down

0 comments on commit 1d9e223

Please sign in to comment.