wallet2: fix misc issues when the ringdb can't be initialized

This commit is contained in:
moneromooo-monero 2018-04-06 20:34:28 +01:00 committed by wowario
parent f7dd0ee122
commit cfd7928365
No known key found for this signature in database
GPG key ID: 24DCBE762DE9C111

View file

@ -5506,7 +5506,8 @@ bool wallet2::add_rings(const crypto::chacha_key &key, const cryptonote::transac
{
if (!m_ringdb)
return false;
return m_ringdb->add_rings(key, tx);
try { return m_ringdb->add_rings(key, tx); }
catch (const std::exception &e) { return false; }
}
bool wallet2::add_rings(const cryptonote::transaction_prefix &tx)
@ -5529,7 +5530,8 @@ bool wallet2::get_ring(const crypto::chacha_key &key, const crypto::key_image &k
{
if (!m_ringdb)
return false;
return m_ringdb->get_ring(key, key_image, outs);
try { return m_ringdb->get_ring(key, key_image, outs); }
catch (const std::exception &e) { return false; }
}
bool wallet2::get_rings(const crypto::hash &txid, std::vector<std::pair<crypto::key_image, std::vector<uint64_t>>> &outs)
@ -5650,13 +5652,16 @@ bool wallet2::blackball_output(const crypto::public_key &output)
{
if (!m_ringdb)
return false;
return m_ringdb->blackball(output);
try { return m_ringdb->blackball(output); }
catch (const std::exception &e) { return false; }
}
bool wallet2::set_blackballed_outputs(const std::vector<crypto::public_key> &outputs, bool add)
{
if (!m_ringdb)
return false;
try
{
bool ret = true;
if (!add)
ret &= m_ringdb->clear_blackballs();
@ -5664,19 +5669,23 @@ bool wallet2::set_blackballed_outputs(const std::vector<crypto::public_key> &out
ret &= m_ringdb->blackball(output);
return ret;
}
catch (const std::exception &e) { return false; }
}
bool wallet2::unblackball_output(const crypto::public_key &output)
{
if (!m_ringdb)
return false;
return m_ringdb->unblackball(output);
try { return m_ringdb->unblackball(output); }
catch (const std::exception &e) { return false; }
}
bool wallet2::is_output_blackballed(const crypto::public_key &output) const
{
if (!m_ringdb)
return false;
return m_ringdb->blackballed(output);
try { return m_ringdb->blackballed(output); }
catch (const std::exception &e) { return false; }
}
bool wallet2::tx_add_fake_output(std::vector<std::vector<tools::wallet2::get_outs_entry>> &outs, uint64_t global_index, const crypto::public_key& output_public_key, const rct::key& mask, uint64_t real_index, bool unlocked) const