mirror of
https://github.com/monero-project/monero.git
synced 2024-11-18 10:01:02 +00:00
blockchain: return error when requesting non existent output
avoids RPC thread dying, causing the wallet to timeout
This commit is contained in:
parent
8a7b3ff138
commit
4f3a4fb701
1 changed files with 13 additions and 6 deletions
|
@ -1956,6 +1956,8 @@ 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());
|
||||||
|
try
|
||||||
|
{
|
||||||
for (const auto &i: req.outputs)
|
for (const auto &i: req.outputs)
|
||||||
{
|
{
|
||||||
// get tx_hash, tx_out_index from DB
|
// get tx_hash, tx_out_index from DB
|
||||||
|
@ -1965,6 +1967,11 @@ bool Blockchain::get_outs(const COMMAND_RPC_GET_OUTPUTS_BIN::request& req, COMMA
|
||||||
|
|
||||||
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 a new issue