diff options
author | Riccardo Spagni <ric@spagni.net> | 2016-10-22 22:12:17 +0200 |
---|---|---|
committer | Riccardo Spagni <ric@spagni.net> | 2016-10-22 22:12:17 +0200 |
commit | 9feb358e46980db5fb2dc11becb0f479c5e6582c (patch) | |
tree | 1cb33e22370f2920b4dde31bcda35de58803da5b /src/wallet/api | |
parent | Merge pull request #1219 (diff) | |
parent | wallet: improve error messages when not enough money for transfer (diff) | |
download | monero-9feb358e46980db5fb2dc11becb0f479c5e6582c.tar.xz |
Merge pull request #1220
e76dcdd wallet: improve error messages when not enough money for transfer (moneromooo-monero)
Diffstat (limited to 'src/wallet/api')
-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()) % |