blockchain: return error when requesting non existent output

avoids RPC thread dying, causing the wallet to timeout
release-v0.4.0.1
moneromooo-monero 6 years ago
parent 1d3874dabf
commit 8e64b61663
No known key found for this signature in database
GPG Key ID: 686F07454D6CEFC3

@ -1941,6 +1941,8 @@ bool Blockchain::get_outs(const COMMAND_RPC_GET_OUTPUTS_BIN::request& req, COMMA
res.outs.clear();
res.outs.reserve(req.outputs.size());
try
{
for (const auto &i: req.outputs)
{
// get tx_hash, tx_out_index from DB
@ -1950,6 +1952,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});
}
}
catch (const std::exception &e)
{
return false;
}
return true;
}
//------------------------------------------------------------------

Loading…
Cancel
Save