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

Avoid creating more than one refund payout #5649

Merged
merged 1 commit into from
Aug 12, 2021

Conversation

sqrrm
Copy link
Member

@sqrrm sqrrm commented Aug 2, 2021

Double clicking the close ticketbutton creates two payout transactions.
This fix makes sure only one payout transaction is created for the
dispute.

Restarting the client allows for creating another refund transaction
for the dispute if needed.

Refund agent reported a case of a refund being done twice. This PR makes sure that two transactions are not created for the same refund during one session. It's still possible to restart the client to make another refund for an already closed ticket if needed.

I managed to reproduce at least one case of double refund transactions by double clicking the close ticket button, there might be other ways to trigger the refund payout twice, but with this fix it will only create one refund transaction no matter which way the payout was triggered.

Double clicking the close ticketbutton creates two payout transactions.
This fix makes sure only one payout transaction is created for the
dispute.

Restarting the client allows for creating another refund transaction
for the dispute if needed.
@sqrrm
Copy link
Member Author

sqrrm commented Aug 12, 2021

@jmacxx could you review this one? Would be good to build a special release for refund agent.

@@ -673,6 +673,13 @@ private void addButtons(Contract contract) {
}

private void showPayoutTxConfirmation(Contract contract, DisputeResult disputeResult, ResultHandler resultHandler) {
if (dispute.isPayoutDone()) {
new Popup().headLine(Res.get("disputeSummaryWindow.close.alreadyPaid.headline"))
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The payoutDone guard works fine, and it issues the log warning about avoiding double payouts. However I cannot get this warning popup to show - so it seems redundant.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You get this warning if you try to do a payout on the same user twice without closing the counterparty ticket first.

Copy link

@ghost ghost left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It solves the issue of being able to make multiple payouts by double clicks on the Close Ticket button, but the new warning popup seems redundant as it is never shown. [edit] all good.

Copy link

@ghost ghost left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ACK (sqrrm explained how to get the warning popup to show).

Copy link
Contributor

@ripcurlx ripcurlx left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

utACK

@ripcurlx ripcurlx merged commit 9db2c18 into bisq-network:master Aug 12, 2021
@ripcurlx ripcurlx added this to the v1.7.3 milestone Aug 12, 2021
@refund-agent2
Copy link

Many thanks for the fix, during the reimbursements I did today I got the alert message about 2 payouts being generated and the need to restart the client.

@sqrrm
Copy link
Member Author

sqrrm commented Aug 26, 2021

@refund-agent2 good to know it's all working as expected now. It's strange this hasn't happened before as it was an old bug, not something introduced recently.

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 this pull request may close these issues.

3 participants