add try catch to MicroCore::get_tx

master
moneroexamples 5 years ago
parent 8663f43f40
commit ad91f74acd

@ -137,7 +137,15 @@ MicroCore::get_tx(const crypto::hash& tx_hash, transaction& tx)
if (m_blockchain_storage.have_tx(tx_hash)) if (m_blockchain_storage.have_tx(tx_hash))
{ {
// get transaction with given hash // get transaction with given hash
tx = m_blockchain_storage.get_db().get_tx(tx_hash); try
{
tx = m_blockchain_storage.get_db().get_tx(tx_hash);
}
catch (TX_DNE const& e)
{
cerr << "MicroCore::get_tx: " << e.what() << endl;
return false;
}
} }
else else
{ {

Loading…
Cancel
Save