-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Add feature for cloning an offer with shared maker fee #6675
Add feature for cloning an offer with shared maker fee #6675
Conversation
Pick a more user friendly name instead of OCO. Clean up code.
The numTransactions param in getRecentTransactions delivers all transactions if it is 0 but that is not intuitive. Passing Integer.MAX_VALUE makes more sense. Signed-off-by: HenrikJannsen <[email protected]>
…eeded. Multiple calls will call add on the hashset but as the entry is the same it will not trigger any change of the hashset. Signed-off-by: HenrikJannsen <[email protected]>
btcWalletService.getAddressEntriesForOpenOffer() contains also OFFER_FUNDING entries. This version minimizes the change by mapping to address and use distinct to avoid duplicate entries to be summed up. Signed-off-by: HenrikJannsen <[email protected]>
Signed-off-by: HenrikJannsen <[email protected]>
Signed-off-by: HenrikJannsen <[email protected]>
Hide trigger price column if none is in list Signed-off-by: HenrikJannsen <[email protected]>
Signed-off-by: HenrikJannsen <[email protected]>
Signed-off-by: HenrikJannsen <[email protected]>
Signed-off-by: HenrikJannsen <[email protected]>
Signed-off-by: HenrikJannsen <[email protected]>
Change flow of cloning an offer: We open the clone offer tab similar like the duplicate/edit offer tab. When clicking the clone button we create and publish the cloned offer. if the clone would not have changed the payment method/currency we show a popup and deactivate the offer. At editOffer we check if the offer is using a shared maker fee and if so we check if the edit triggered same payment method/currency. If so we show a popup and deactivate the offer. Signed-off-by: HenrikJannsen <[email protected]>
Signed-off-by: HenrikJannsen <[email protected]>
Signed-off-by: HenrikJannsen <[email protected]>
…ssEntries Signed-off-by: HenrikJannsen <[email protected]>
Please ignore the codacy warning. I use the nested if statement for better readability and comments. |
Signed-off-by: HenrikJannsen <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The clone offer icon is shown for BSQ swaps in Portfolio view, clicking it has no visible effect. Same for the context menu.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
BUG: In mainnet, the security deposit is different for each clone! For example a sell offer was created with 20% security deposit. Then it was cloned but the security deposit in the new offer is 21.2908%. (The shared maker fee UTXO contains 20%). The clone(edit) offer screen recalculates the security deposit each time. When cloning to an altcoin, the security deposit is lowered to 15%.
Results in a failed trade:
An error occurred when someone tried to take one of your offers:
An error occurred at task: SellerAsMakerCreatesUnsignedDepositTx
Exception message: org.bitcoinj.core.InsufficientMoneyException: Insufficient money, missing x.xxxx BTC
Timeout reached. Protocol did not complete in 120 sec.
The trade protocol encountered some problems.
The trade contract is not set.
…hich must not get changed (like security deposit could get adjusted by the UI). Signed-off-by: HenrikJannsen <[email protected]>
Signed-off-by: HenrikJannsen <[email protected]>
Should be fixed with latest 2 commits. Thanks for finding the bug. |
Signed-off-by: HenrikJannsen <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Create an offer.
- Clone it.
- Delete one of them.
- Restart Bisq.
- The offer reserved amount is now spendable from the wallet.
The scenario was discussed here.
Signed-off-by: HenrikJannsen <[email protected]>
Signed-off-by: HenrikJannsen <[email protected]>
Ok. I see now your point why doing that in AddressEntry. Reapplied from your version... |
Signed-off-by: HenrikJannsen <[email protected]>
Tested Fiat -> XMR clone and when taking XMR offer it worked. But have not extensively tested specially with auto-confirm.... |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ACK
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Signed-off-by: HenrikJannsen <[email protected]>
…n doActivate. Do not create a new observableArrayList in filterPaymentAccounts. The reason why the wrong account gets selected is not completely clear to me. The selection handler gets called when the combobox gets filled and that overwrites the selected account from the data. It seems that the new observableArrayList in filterPaymentAccounts triggered that un-expected behaviour.
48f8867
to
dbd1098
Compare
…icateOfferTab or cloneOpenOfferTab Signed-off-by: HenrikJannsen <[email protected]>
@jmacxx Recent commits fixed the reported bugs. Last commit was not related to the bugs but should apply the behavior for editOffer to the other new tabs. |
I have written a wiki for the cloned offer feature: https://bisq.wiki/Cloning_an_offer Will add some images and tidy it up when the feature is live. Please can a link to the wiki be added to the bottom of this pop-up.
So I can add a little more info to the wiki please can you let me know:
|
Signed-off-by: HenrikJannsen <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you duplicate an offer, the account used in that offer should be shown. Instead a different account is shown, possibly the first account in the list.
Signed-off-by: HenrikJannsen <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
utACK
@gabernard Could you merge this, please? I cannot press the "merge" button because of the failed "Codacy Static Code Analysis". |
Based the work of @jmacxx PR (#6605) this PR changes the flow of creating a cloned offer.
It adds a "Clone offer" tab similar to the duplicate offer tab. When the user clicks the "Clone offer" icon or context menu it navigates to the clone offer view (which is derived from the edit offer view) and the user can change the price, payment method and currency and trigger price. It created a new offer based on the source offer with the edited fields and the same maker fee txId as the source offer. If payment method or price are changed it activates and publishes the offer, otherwise it shows a popup and deactivates the offer.