Merge pull request #1220

e76dcdd wallet: improve error messages when not enough money for transfer (moneromooo-monero)
This commit is contained in:
Riccardo Spagni 2016-10-22 22:12:17 +02:00
commit 9feb358e46
No known key found for this signature in database
GPG key ID: 55432DF31CCD4FCD
4 changed files with 87 additions and 9 deletions

View file

@ -595,6 +595,15 @@ PendingTransaction *WalletImpl::createTransaction(const string &dst_addr, const
m_status = Status_Error;
std::ostringstream writer;
writer << boost::format(tr("not enough money to transfer, available only %s, sent amount %s")) %
print_money(e.available()) %
print_money(e.tx_amount());
m_errorString = writer.str();
} catch (const tools::error::tx_not_possible& e) {
m_status = Status_Error;
std::ostringstream writer;
writer << boost::format(tr("not enough money to transfer, available only %s, transaction amount %s = %s + %s (fee)")) %
print_money(e.available()) %
print_money(e.tx_amount() + e.fee()) %