mirror of
https://github.com/monero-project/monero.git
synced 2025-10-11 10:58:31 -04:00
Merge pull request #2546
b2d416f2
Distinguish "not enough money" and "not enough unlocked money" (binaryFate)
This commit is contained in:
commit
32b083d8bd
5 changed files with 96 additions and 14 deletions
|
@ -1146,7 +1146,7 @@ PendingTransaction *WalletImpl::createTransaction(const string &dst_addr, const
|
|||
m_errorString = (boost::format(tr("failed to get random outputs to mix: %s")) % e.what()).str();
|
||||
m_status = Status_Error;
|
||||
|
||||
} catch (const tools::error::not_enough_money& e) {
|
||||
} catch (const tools::error::not_enough_unlocked_money& e) {
|
||||
m_status = Status_Error;
|
||||
std::ostringstream writer;
|
||||
|
||||
|
@ -1155,6 +1155,15 @@ PendingTransaction *WalletImpl::createTransaction(const string &dst_addr, const
|
|||
print_money(e.tx_amount());
|
||||
m_errorString = writer.str();
|
||||
|
||||
} catch (const tools::error::not_enough_money& e) {
|
||||
m_status = Status_Error;
|
||||
std::ostringstream writer;
|
||||
|
||||
writer << boost::format(tr("not enough money to transfer, overall balance 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;
|
||||
|
@ -1240,7 +1249,7 @@ PendingTransaction *WalletImpl::createSweepUnmixableTransaction()
|
|||
m_errorString = tr("failed to get random outputs to mix");
|
||||
m_status = Status_Error;
|
||||
|
||||
} catch (const tools::error::not_enough_money& e) {
|
||||
} catch (const tools::error::not_enough_unlocked_money& e) {
|
||||
m_status = Status_Error;
|
||||
std::ostringstream writer;
|
||||
|
||||
|
@ -1249,6 +1258,15 @@ PendingTransaction *WalletImpl::createSweepUnmixableTransaction()
|
|||
print_money(e.tx_amount());
|
||||
m_errorString = writer.str();
|
||||
|
||||
} catch (const tools::error::not_enough_money& e) {
|
||||
m_status = Status_Error;
|
||||
std::ostringstream writer;
|
||||
|
||||
writer << boost::format(tr("not enough money to transfer, overall balance 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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue