mirror of
https://github.com/monero-project/monero.git
synced 2025-08-25 09:39:27 -04:00
Merge pull request #1220
e76dcdd
wallet: improve error messages when not enough money for transfer (moneromooo-monero)
This commit is contained in:
commit
9feb358e46
4 changed files with 87 additions and 9 deletions
|
@ -2563,13 +2563,20 @@ bool simple_wallet::transfer_main(int transfer_type, const std::vector<std::stri
|
|||
fail_msg_writer() << tr("failed to get random outputs to mix");
|
||||
}
|
||||
catch (const tools::error::not_enough_money& e)
|
||||
{
|
||||
LOG_PRINT_L0(boost::format("not enough money to transfer, available only %s, sent amount %s") %
|
||||
print_money(e.available()) %
|
||||
print_money(e.tx_amount()));
|
||||
fail_msg_writer() << tr("Not enough money in unlocked balance");
|
||||
}
|
||||
catch (const tools::error::tx_not_possible& e)
|
||||
{
|
||||
LOG_PRINT_L0(boost::format("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()) %
|
||||
print_money(e.tx_amount()) %
|
||||
print_money(e.fee()));
|
||||
fail_msg_writer() << tr("Failed to find a way to create transactions. This is usually due to dust which is so small it cannot pay for itself in fees");
|
||||
fail_msg_writer() << tr("Failed to find a way to create transactions. This is usually due to dust which is so small it cannot pay for itself in fees, or trying to send more money than the unlocked balance, or not leaving enough for fees");
|
||||
}
|
||||
catch (const tools::error::not_enough_outs_to_mix& e)
|
||||
{
|
||||
|
@ -2824,13 +2831,20 @@ bool simple_wallet::locked_transfer(const std::vector<std::string> &args_)
|
|||
fail_msg_writer() << tr("failed to get random outputs to mix");
|
||||
}
|
||||
catch (const tools::error::not_enough_money& e)
|
||||
{
|
||||
LOG_PRINT_L0(boost::format("not enough money to transfer, available only %s, sent amount %s") %
|
||||
print_money(e.available()) %
|
||||
print_money(e.tx_amount()));
|
||||
fail_msg_writer() << tr("Not enough money in unlocked balance");
|
||||
}
|
||||
catch (const tools::error::tx_not_possible& e)
|
||||
{
|
||||
LOG_PRINT_L0(boost::format("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()) %
|
||||
print_money(e.tx_amount()) %
|
||||
print_money(e.fee()));
|
||||
fail_msg_writer() << tr("Not enough money to transfer.");
|
||||
fail_msg_writer() << tr("Failed to find a way to create transactions. This is usually due to dust which is so small it cannot pay for itself in fees, or trying to send more money than the unlocked balance, or not leaving enough for fees");
|
||||
}
|
||||
catch (const tools::error::not_enough_outs_to_mix& e)
|
||||
{
|
||||
|
@ -2983,13 +2997,20 @@ bool simple_wallet::sweep_unmixable(const std::vector<std::string> &args_)
|
|||
fail_msg_writer() << tr("failed to get random outputs to mix");
|
||||
}
|
||||
catch (const tools::error::not_enough_money& e)
|
||||
{
|
||||
LOG_PRINT_L0(boost::format("not enough money to transfer, available only %s, sent amount %s") %
|
||||
print_money(e.available()) %
|
||||
print_money(e.tx_amount()));
|
||||
fail_msg_writer() << tr("Not enough money in unlocked balance");
|
||||
}
|
||||
catch (const tools::error::tx_not_possible& e)
|
||||
{
|
||||
LOG_PRINT_L0(boost::format("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()) %
|
||||
print_money(e.tx_amount()) %
|
||||
print_money(e.fee()));
|
||||
fail_msg_writer() << tr("Failed to find a way to create transactions. This is usually due to dust which is so small it cannot pay for itself in fees");
|
||||
fail_msg_writer() << tr("Failed to find a way to create transactions. This is usually due to dust which is so small it cannot pay for itself in fees, or trying to send more money than the unlocked balance, or not leaving enough for fees");
|
||||
}
|
||||
catch (const tools::error::not_enough_outs_to_mix& e)
|
||||
{
|
||||
|
@ -3238,13 +3259,20 @@ bool simple_wallet::sweep_all(const std::vector<std::string> &args_)
|
|||
fail_msg_writer() << tr("failed to get random outputs to mix");
|
||||
}
|
||||
catch (const tools::error::not_enough_money& e)
|
||||
{
|
||||
LOG_PRINT_L0(boost::format("not enough money to transfer, available only %s, sent amount %s") %
|
||||
print_money(e.available()) %
|
||||
print_money(e.tx_amount()));
|
||||
fail_msg_writer() << tr("Not enough money in unlocked balance");
|
||||
}
|
||||
catch (const tools::error::tx_not_possible& e)
|
||||
{
|
||||
LOG_PRINT_L0(boost::format("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()) %
|
||||
print_money(e.tx_amount()) %
|
||||
print_money(e.fee()));
|
||||
fail_msg_writer() << tr("Failed to find a way to create transactions. This is usually due to dust which is so small it cannot pay for itself in fees");
|
||||
fail_msg_writer() << tr("Failed to find a way to create transactions. This is usually due to dust which is so small it cannot pay for itself in fees, or trying to send more money than the unlocked balance, or not leaving enough for fees");
|
||||
}
|
||||
catch (const tools::error::not_enough_outs_to_mix& e)
|
||||
{
|
||||
|
@ -3472,11 +3500,19 @@ bool simple_wallet::submit_transfer(const std::vector<std::string> &args_)
|
|||
}
|
||||
catch (const tools::error::not_enough_money& e)
|
||||
{
|
||||
fail_msg_writer() << boost::format(tr("not enough money to transfer, available only %s, transaction amount %s = %s + %s (fee)")) %
|
||||
LOG_PRINT_L0(boost::format("not enough money to transfer, available only %s, sent amount %s") %
|
||||
print_money(e.available()) %
|
||||
print_money(e.tx_amount() + e.fee()) %
|
||||
print_money(e.tx_amount()));
|
||||
fail_msg_writer() << tr("Not enough money in unlocked balance");
|
||||
}
|
||||
catch (const tools::error::tx_not_possible& e)
|
||||
{
|
||||
LOG_PRINT_L0(boost::format("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()) %
|
||||
print_money(e.tx_amount()) %
|
||||
print_money(e.fee());
|
||||
print_money(e.fee()));
|
||||
fail_msg_writer() << tr("Failed to find a way to create transactions. This is usually due to dust which is so small it cannot pay for itself in fees, or trying to send more money than the unlocked balance, or not leaving enough for fees");
|
||||
}
|
||||
catch (const tools::error::not_enough_outs_to_mix& e)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue