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

[Improvement] Prevent burning 5 XRP Fee for an invalid AccountDelete #325

Closed
WietseWind opened this issue Mar 9, 2021 · 0 comments
Closed
Assignees
Labels
App iOS/Android App

Comments

@WietseWind
Copy link
Member

When sending an AccountDelete, 5 XRP (fee) will be burned even if the action is invalid. The most common reason for the AccountDelete to be invalid is tecTOO_SOON:

"Occurs if the sender's Sequence number is too high. The transaction's Sequence number plus 256 must be less than the current Ledger Index."

A common reason for this to happen is when one deletes an account, funds it again and tries to delete it again relatively shortly after deleting it the first time around.

We can easily detect that upfront, before sending (and thus allowing the XRPL to burn) the 5 XRP fee.

Pseudo code (sample: Testnet: rHB9yje7AJ7VrYxwmMXQQJNYWjXUduuv57)

  • The account (to be deleted) sequence is 15597090
  • The Ledger Index is 15597418
  • The account (to be deleted) sequence + 256 = 15597090 + 256 = 15597346
  • 15597346 (account sequence) > 15597418 (ledger index) so in this example: 15597346-15597418 = -72, which is negative. It takes Abs(72) = 72 more ledgers to close before this account can be deleted again.

Proposed change

When XUMM opens a Sign Request for an AccountDelete and this ^^ is the case, we should hide the existing red warning message and hide the Slide to Sign button and instead show a message:

This account cannot be deleted (yet). It takes {Abs(...)} more ledgers to close before this account can be deleted.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
App iOS/Android App
Projects
None yet
Development

No branches or pull requests

2 participants