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

Error when placing an offer #4372

Closed
bitsanity opened this issue Jul 23, 2020 · 5 comments · Fixed by #4383
Closed

Error when placing an offer #4372

bitsanity opened this issue Jul 23, 2020 · 5 comments · Fixed by #4383

Comments

@bitsanity
Copy link

Description

An error pops up when I form an offer and try to submit it and the offer has a "minimum BTC" value.

Version

1.3.6

Steps to reproduce

  1. Create New Offer to Buy BTC with CAD
  2. Fill out the form - set amount and price - I'm setting 0.07 BTC with a 0% spread and a minimum BTC of 0.015
  3. Funding with 0.46 BSQ
  4. Next Step: Fund your offer (works)
  5. Transfer Funds from Bisq Wallet (works)
  6. Review: Place Offer to Buy Bitcoin (works)
  7. Confirm: Place Offer to Buy Bitcoin (ERROR)

Expected behaviour

Offer should be posted

Actual behaviour

Offer isn't posted

Screenshots

bisqerror

Device or machine

Ubuntu Linux 64-bit on Intel x86_64

Additional info

Scenario works if I make another offer with no minimum BTC, so I suspect there's a bug in the minimum BTC feature

@ghost
Copy link

ghost commented Jul 24, 2020

Would you be able to confirm if there is an error message in your logs to the effect of "Insufficient money, missing x.xx BTC"?

@bitsanity
Copy link
Author

Something interesting in the logs below.

Jul-23 07:43:13.630 [JavaFX Application Thread] ERROR b.c.t.Task: An error occurred at task: CreateMakerFeeTx java.lang.IllegalArgumentException: The change output of 5.41 BSQ is below the min. dust value of 5.46. At least 5.92 BSQ is needed for this transaction at com.google.common.base.Preconditions.checkArgument(Preconditions.java:122) at bisq.core.btc.wallet.BsqWalletService.addInputsAndChangeOutputForTx(BsqWalletService.java:699) at bisq.core.btc.wallet.BsqWalletService.getPreparedTradeFeeTx(BsqWalletService.java:592) at bisq.core.offer.placeoffer.tasks.CreateMakerFeeTx.run(CreateMakerFeeTx.java:113) at bisq.common.taskrunner.TaskRunner.next(TaskRunner.java:69) at bisq.common.taskrunner.TaskRunner.handleComplete(TaskRunner.java:86) at bisq.common.taskrunner.Task.complete(Task.java:58) at bisq.core.offer.placeoffer.tasks.CheckNumberOfUnconfirmedTransactions.run(CheckNumberOfUnconfirmedTransactions.java:18) at bisq.common.taskrunner.TaskRunner.next(TaskRunner.java:69) at bisq.common.taskrunner.TaskRunner.handleComplete(TaskRunner.java:86) at bisq.common.taskrunner.Task.complete(Task.java:58) at bisq.core.offer.placeoffer.tasks.ValidateOffer.run(ValidateOffer.java:101) at bisq.common.taskrunner.TaskRunner.next(TaskRunner.java:69) at bisq.common.taskrunner.TaskRunner.run(TaskRunner.java:60) at bisq.core.offer.placeoffer.PlaceOfferProtocol.placeOffer(PlaceOfferProtocol.java:86) at bisq.core.offer.OpenOfferManager.placeOffer(OpenOfferManager.java:386) at bisq.desktop.main.offer.MutableOfferDataModel.onPlaceOffer(MutableOfferDataModel.java:312) at bisq.desktop.main.offer.MutableOfferViewModel.onPlaceOffer(MutableOfferViewModel.java:659) at bisq.desktop.main.offer.MutableOfferView.lambda$onPlaceOffer$2(MutableOfferView.java:358) at java.base/java.util.Optional.ifPresent(Optional.java:172) at bisq.desktop.main.overlays.windows.OfferDetailsWindow.lambda$addConfirmAndCancelButtons$2(OfferDetailsWindow.java:397) Jul-23 07:43:13.630 [JavaFX Application Thread] ERROR b.c.t.TaskRunner: Task failed: CreateMakerFeeTx / errorMessage: An error occurred at task: CreateMakerFeeTx

@ghost
Copy link

ghost commented Jul 27, 2020

The trade fee was burning of 0.46 BSQ (a send-to-self transaction). Due to Bitcoin dust limits, bisq was looking for 5.92 BSQ however there was only 5.87 BSQ available. The resultant change of 5.41 BSQ is below the dust threshold, causing this error.

We could include a popup warning at step 3 or 4 (funding) if the available BSQ balance is low.

At step 7, when it is building the transaction, I propose a code fix to burn any below-dust change (5.41 BSQ in this case). The offer would then have been successful. Due to the nature of BSQ being colored bitcoin, balances close to 5.46 are useless. You can make them usable by keeping the BSQ balance topped up when it nears that level.

[edit] - opted not to do that option ☝️ since it seemed quite bad to burn up to 5.46 BSQ without user's consent. Instead if an offer attempts to spend into the floor (dust) amount the user will be informed that they are missing x amount of BSQ and can either reduce the offer amount or add more BSQ.

@bitsanity
Copy link
Author

Thanks! Yes I was only looking at trade fee and missed the total BSQ balance.

@ghost
Copy link

ghost commented Jul 28, 2020

In this particular example, the fix would show a warning at step 3 as such:

image

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

Successfully merging a pull request may close this issue.

1 participant