mirror of
https://git.wownero.com/wownero/wownero.git
synced 2024-08-15 01:03:23 +00:00
wallet2: fix misc issues when the ringdb can't be initialized
This commit is contained in:
parent
f7dd0ee122
commit
cfd7928365
1 changed files with 20 additions and 11 deletions
|
@ -5506,7 +5506,8 @@ bool wallet2::add_rings(const crypto::chacha_key &key, const cryptonote::transac
|
||||||
{
|
{
|
||||||
if (!m_ringdb)
|
if (!m_ringdb)
|
||||||
return false;
|
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)
|
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)
|
if (!m_ringdb)
|
||||||
return false;
|
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)
|
bool wallet2::get_rings(const crypto::hash &txid, std::vector<std::pair<crypto::key_image, std::vector<uint64_t>>> &outs)
|
||||||
|
@ -5650,33 +5652,40 @@ bool wallet2::blackball_output(const crypto::public_key &output)
|
||||||
{
|
{
|
||||||
if (!m_ringdb)
|
if (!m_ringdb)
|
||||||
return false;
|
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)
|
bool wallet2::set_blackballed_outputs(const std::vector<crypto::public_key> &outputs, bool add)
|
||||||
{
|
{
|
||||||
if (!m_ringdb)
|
if (!m_ringdb)
|
||||||
return false;
|
return false;
|
||||||
|
try
|
||||||
|
{
|
||||||
bool ret = true;
|
bool ret = true;
|
||||||
if (!add)
|
if (!add)
|
||||||
ret &= m_ringdb->clear_blackballs();
|
ret &= m_ringdb->clear_blackballs();
|
||||||
for (const auto &output: outputs)
|
for (const auto &output: outputs)
|
||||||
ret &= m_ringdb->blackball(output);
|
ret &= m_ringdb->blackball(output);
|
||||||
return ret;
|
return ret;
|
||||||
|
}
|
||||||
|
catch (const std::exception &e) { return false; }
|
||||||
}
|
}
|
||||||
|
|
||||||
bool wallet2::unblackball_output(const crypto::public_key &output)
|
bool wallet2::unblackball_output(const crypto::public_key &output)
|
||||||
{
|
{
|
||||||
if (!m_ringdb)
|
if (!m_ringdb)
|
||||||
return false;
|
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
|
bool wallet2::is_output_blackballed(const crypto::public_key &output) const
|
||||||
{
|
{
|
||||||
if (!m_ringdb)
|
if (!m_ringdb)
|
||||||
return false;
|
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
|
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
|
||||||
|
|
Loading…
Reference in a new issue