Skip to content
This repository has been archived by the owner on Jan 22, 2025. It is now read-only.

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 😉

# for free to subscribe to this conversation on GitHub. Already have an account? #.
Labels
good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants