diff options
author | moneromooo-monero <moneromooo-monero@users.noreply.github.com> | 2016-10-15 14:30:50 +0100 |
---|---|---|
committer | moneromooo-monero <moneromooo-monero@users.noreply.github.com> | 2016-10-15 14:31:40 +0100 |
commit | e76dcdd8109c288c346e45a396839c94633b03cb (patch) | |
tree | d14386f0ba3dfc7789dfe9d8770f2defdcc930cd /src/wallet/api | |
parent | Merge pull request #1203 (diff) | |
download | monero-e76dcdd8109c288c346e45a396839c94633b03cb.tar.xz |
wallet: improve error messages when not enough money for transfer
Diffstat (limited to '')
-rw-r--r-- | src/wallet/api/wallet.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/wallet/api/wallet.cpp b/src/wallet/api/wallet.cpp index d1c849537..94d62666a 100644 --- a/src/wallet/api/wallet.cpp +++ b/src/wallet/api/wallet.cpp @@ -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()) % |