Merge pull request #3804

89e51ec simple-wallet-cli: Add warnings about inaccurate balances to to watch-only wallet (jcktm)
This commit is contained in:
luigi1111 2018-06-16 14:15:52 -05:00
commit 9226acca4b
No known key found for this signature in database
GPG key ID: F4ACA0183641E010
3 changed files with 11 additions and 0 deletions

View file

@ -4063,6 +4063,8 @@ bool simple_wallet::show_balance_unlocked(bool detailed)
std::string extra; std::string extra;
if (m_wallet->has_multisig_partial_key_images()) if (m_wallet->has_multisig_partial_key_images())
extra = tr(" (Some owned outputs have partial key images - import_multisig_info needed)"); extra = tr(" (Some owned outputs have partial key images - import_multisig_info needed)");
else if (m_wallet->has_unknown_key_images())
extra += tr(" (Some owned outputs have missing key images - import_key_images needed)");
success_msg_writer() << tr("Currently selected account: [") << m_current_subaddress_account << tr("] ") << m_wallet->get_subaddress_label({m_current_subaddress_account, 0}); success_msg_writer() << tr("Currently selected account: [") << m_current_subaddress_account << tr("] ") << m_wallet->get_subaddress_label({m_current_subaddress_account, 0});
const std::string tag = m_wallet->get_account_tags().second[m_current_subaddress_account]; const std::string tag = m_wallet->get_account_tags().second[m_current_subaddress_account];
success_msg_writer() << tr("Tag: ") << (tag.empty() ? std::string{tr("(No tag assigned)")} : tag); success_msg_writer() << tr("Tag: ") << (tag.empty() ? std::string{tr("(No tag assigned)")} : tag);

View file

@ -3624,6 +3624,14 @@ bool wallet2::has_multisig_partial_key_images() const
return false; return false;
} }
bool wallet2::has_unknown_key_images() const
{
for (const auto &td: m_transfers)
if (!td.m_key_image_known)
return true;
return false;
}
/*! /*!
* \brief Rewrites to the wallet file for wallet upgrade (doesn't generate key, assumes it's already there) * \brief Rewrites to the wallet file for wallet upgrade (doesn't generate key, assumes it's already there)
* \param wallet_name Name of wallet file (should exist) * \param wallet_name Name of wallet file (should exist)

View file

@ -655,6 +655,7 @@ namespace tools
bool watch_only() const { return m_watch_only; } bool watch_only() const { return m_watch_only; }
bool multisig(bool *ready = NULL, uint32_t *threshold = NULL, uint32_t *total = NULL) const; bool multisig(bool *ready = NULL, uint32_t *threshold = NULL, uint32_t *total = NULL) const;
bool has_multisig_partial_key_images() const; bool has_multisig_partial_key_images() const;
bool has_unknown_key_images() const;
bool get_multisig_seed(std::string& seed, const epee::wipeable_string &passphrase = std::string(), bool raw = true) const; bool get_multisig_seed(std::string& seed, const epee::wipeable_string &passphrase = std::string(), bool raw = true) const;
bool key_on_device() const { return m_key_on_device; } bool key_on_device() const { return m_key_on_device; }