Merge pull request #3904
4f3a4fb
blockchain: return error when requesting non existent output (moneromooo-monero)
This commit is contained in:
commit
5a221c0e48
|
@ -1960,14 +1960,21 @@ bool Blockchain::get_outs(const COMMAND_RPC_GET_OUTPUTS_BIN::request& req, COMMA
|
||||||
|
|
||||||
res.outs.clear();
|
res.outs.clear();
|
||||||
res.outs.reserve(req.outputs.size());
|
res.outs.reserve(req.outputs.size());
|
||||||
for (const auto &i: req.outputs)
|
try
|
||||||
{
|
{
|
||||||
// get tx_hash, tx_out_index from DB
|
for (const auto &i: req.outputs)
|
||||||
const output_data_t od = m_db->get_output_key(i.amount, i.index);
|
{
|
||||||
tx_out_index toi = m_db->get_output_tx_and_index(i.amount, i.index);
|
// get tx_hash, tx_out_index from DB
|
||||||
bool unlocked = is_tx_spendtime_unlocked(m_db->get_tx_unlock_time(toi.first));
|
const output_data_t od = m_db->get_output_key(i.amount, i.index);
|
||||||
|
tx_out_index toi = m_db->get_output_tx_and_index(i.amount, i.index);
|
||||||
|
bool unlocked = is_tx_spendtime_unlocked(m_db->get_tx_unlock_time(toi.first));
|
||||||
|
|
||||||
res.outs.push_back({od.pubkey, od.commitment, unlocked, od.height, toi.first});
|
res.outs.push_back({od.pubkey, od.commitment, unlocked, od.height, toi.first});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (const std::exception &e)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue