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

Box selection inaccurate when there are unconfirmed transactions (transaction is discarded) #5

Closed
MrStahlfelge opened this issue Jul 27, 2021 · 4 comments · Fixed by #90
Labels
annoyance Annoying behaviour, not really a bug or a bug with easy workaround

Comments

@MrStahlfelge
Copy link
Member

MrStahlfelge commented Jul 27, 2021

Steps to reproduce:

  • Send an amount of ERGs to any address
  • While the transaction is not confirmed, do it again

The second transaction is discarded because it selected the same unspent boxes to spend.

Another feature that would be good to have is a way to cancel transactions waiting on the mempool.

@MrStahlfelge MrStahlfelge added the annoyance Annoying behaviour, not really a bug or a bug with easy workaround label Jul 27, 2021
@MrStahlfelge
Copy link
Member Author

You can generate tx with the wallet and use /transactions/check to fully check the tx as mempool does (after accepting tx asynchronously)

@MrStahlfelge MrStahlfelge changed the title Prevent sending transaction when there are unconfirmed transactions (transaction is discarded) Box selection inaccurate when there are unconfirmed transactions (transaction is discarded) Dec 20, 2021
@esot321c
Copy link

Feature request which is related to this issue: Batch transactions. IE i can sent more than one transaction to chain before the previous approves. So if i have 3 transactions to do, i don't have to wait 2 to 5 minutes from the 1st to then send the 2nd manually. Is this a security issue or something potentially plausible?

It could look like this:

  • User wants to send 3 transactions
  • User sends transaction 1, approves it, wallet sends it to chain immediately.
  • User sets up transaction 2, approves it, wallet asks "do you want to cache this transaction to send after the current unprocessed transaction?" or something of this nature, with a link to explain in detail what will be happening behind the scenes.
  • User sets up transaction 3, approves it, wallet caches
  • Transaction 1 completes, user is notified, transaction 2 starts (user could be prompted to cancel or continue perhaps?)
  • transaction 2 completes, wallet sends 3 with a prompt

The current functionality is that the user has to actually keep an eye on the blockchain explorer until their first transaction is approved before sending their second. From a UX perspective, it's not ideal, and many users will not understand why this is this case, or know to check block explorer.

@MrStahlfelge
Copy link
Member Author

Since it looks like we won't get this explorer feature anytime soon, we can also try to get this solved by fetching the mempool from node right before making a transaction and blacklisting all spent boxes.

http://213.239.193.208:9053/transactions/unconfirmed

@MrStahlfelge
Copy link
Member Author

Chained transactions can be supported with the following change:

MrStahlfelge added a commit that referenced this issue Feb 15, 2022
…t and ergo-wallet

* Use new Appkit BoxOperations ExplorerAndPoolUnspentBoxesLoader to better support multiple transactions on same block

* Use new ExplorerAndPoolUnspentBoxesLoader to support chained tx #5

* Appkit feature merged into develop
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
annoyance Annoying behaviour, not really a bug or a bug with easy workaround
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants