Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

solana-cli transfer subcommand naively tries to pay even if unfunded #9899

Closed
ryoqun opened this issue May 6, 2020 · 1 comment · Fixed by #10012
Closed

solana-cli transfer subcommand naively tries to pay even if unfunded #9899

ryoqun opened this issue May 6, 2020 · 1 comment · Fixed by #10012
Labels
good first issue Good for newcomers
Milestone

Comments

@ryoqun
Copy link
Contributor

ryoqun commented May 6, 2020

Problem

Failed system transfers (due to insufficient funds) charges a transaction fee on the payer account. And even if solana-cli can check whether the tx will fail or not because of that in advance, it naive submits the transfer transaction naively.

This is a bit unhelpful. Small, but it causes spending a tx fee and looks silly from the user's viewpoint.

For example, user must again manually calculate the reduced all remaining fund when doing manually this unimplemented thing: #9862

Proposed Solution

Fail by deafult by doing account's fund balance check and introduce --force? But then this will introduce false-positives due to toctou vulnerability. Maybe #8971 is the ultimate fix?

context

https://discord.com/channels/428295358100013066/439194979856809985/707339402250158210

@ryoqun ryoqun added the good first issue Good for newcomers label May 6, 2020
@mvines mvines changed the title solana-cli pay subcommand naively tries to pay even if unfunded solana-cli transfer subcommand naively tries to pay even if unfunded May 6, 2020
@mvines mvines added this to the The Future! milestone May 6, 2020
@t-nelson
Copy link
Contributor

t-nelson commented May 6, 2020

See also: #9406 😉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants