mirror of
https://github.com/monero-project/monero.git
synced 2025-08-25 07:29:23 -04:00
wallet: improve error messages when not enough money for transfer
This commit is contained in:
parent
34fcfcd7cc
commit
e76dcdd810
4 changed files with 87 additions and 9 deletions
|
@ -2549,13 +2549,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)
|
||||
{
|
||||
|
@ -2810,13 +2817,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)
|
||||
{
|
||||
|
@ -2969,13 +2983,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)
|
||||
{
|
||||
|
@ -3224,13 +3245,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)
|
||||
{
|
||||
|
@ -3458,11 +3486,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