wallet: improve error messages when not enough money for transfer

This commit is contained in:
moneromooo-monero
2016-10-15 14:30:50 +01:00
parent 34fcfcd7cc
commit e76dcdd810
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()) %