Change arbitration payout to implement proposal 386...

Do not pay out the security deposit of the trade peer to the
arbitration case winner.
Amounts are filled out based on which option the
Arbitrator chooses:
If BTC buyer is selected as case winner they will get
trade amount + buyer security deposit.
If BTC seller is selected as case winner they will get
trade amount + seller security deposit.
If custom payout is selected arbitrator can specify
custom amounts as they wish.
This commit is contained in:
jmacxx 2022-11-12 21:52:13 -06:00
parent 212cd77db4
commit 66a7a6569d
No known key found for this signature in database
GPG Key ID: 155297BABFE94A1B

View File

@ -80,6 +80,7 @@ import javafx.scene.layout.VBox;
import javafx.geometry.HPos;
import javafx.geometry.Insets;
import javafx.geometry.Pos;
import javafx.beans.binding.Bindings;
import javafx.beans.value.ChangeListener;
@ -311,8 +312,7 @@ public class DisputeSummaryWindow extends Overlay<DisputeSummaryWindow> {
formatter.formatCoinWithCode(contract.getOfferPayload().getSellerSecurityDeposit());
addConfirmationLabelTextField(gridPane, ++rowIndex, Res.get("shared.securityDeposit"), securityDeposit);
boolean isMediationDispute = getDisputeManager(dispute) instanceof MediationManager;
if (isMediationDispute) {
if (isMediationDispute()) {
if (dispute.getTradePeriodEnd().getTime() > 0) {
String status = DisplayUtils.formatDateTime(dispute.getTradePeriodEnd());
Label tradePeriodEnd = addConfirmationLabelLabel(gridPane, ++rowIndex, Res.get("disputeSummaryWindow.tradePeriodEnd"), status).second;
@ -350,10 +350,15 @@ public class DisputeSummaryWindow extends Overlay<DisputeSummaryWindow> {
VBox radioButtonPane = new VBox();
radioButtonPane.setSpacing(10);
radioButtonPane.getChildren().addAll(buyerGetsTradeAmountRadioButton, buyerGetsCompensationRadioButton,
buyerGetsTradeAmountMinusPenaltyRadioButton, sellerGetsTradeAmountRadioButton, sellerGetsCompensationRadioButton, sellerGetsTradeAmountMinusPenaltyRadioButton,
customRadioButton);
if (isMediationDispute()) {
radioButtonPane.getChildren().addAll(buyerGetsTradeAmountRadioButton, buyerGetsCompensationRadioButton,
buyerGetsTradeAmountMinusPenaltyRadioButton, sellerGetsTradeAmountRadioButton,
sellerGetsCompensationRadioButton, sellerGetsTradeAmountMinusPenaltyRadioButton,
customRadioButton);
} else {
radioButtonPane.getChildren().addAll(buyerGetsTradeAmountRadioButton, sellerGetsTradeAmountRadioButton,
customRadioButton);
}
addTopLabelWithVBox(gridPane, ++rowIndex, Res.get("disputeSummaryWindow.payout"), radioButtonPane, 0);
tradeAmountToggleGroup = new ToggleGroup();
@ -435,10 +440,9 @@ public class DisputeSummaryWindow extends Overlay<DisputeSummaryWindow> {
}
Contract contract = dispute.getContract();
boolean isMediationDispute = getDisputeManager(dispute) instanceof MediationManager;
// At mediation we require a min. payout to the losing party to keep incentive for the trader to accept the
// mediated payout. For Refund agent cases we do not have that restriction.
Coin minRefundAtDispute = isMediationDispute ? Restrictions.getMinRefundAtMediatedDispute(contract.getTradeAmount()) : Coin.ZERO;
Coin minRefundAtDispute = isMediationDispute() ? Restrictions.getMinRefundAtMediatedDispute(contract.getTradeAmount()) : Coin.ZERO;
Offer offer = new Offer(contract.getOfferPayload());
Coin totalAvailable = contract.getTradeAmount()
@ -469,7 +473,7 @@ public class DisputeSummaryWindow extends Overlay<DisputeSummaryWindow> {
Coin sellerAmountFromField = ParsingUtils.parseToCoin(sellerPayoutAmountInputTextField.getText(), formatter);
Coin totalAmountFromFields = enteredAmount.add(sellerAmountFromField);
// RefundAgent can enter less then available
if (isMediationDispute ||
if (isMediationDispute() ||
totalAmountFromFields.compareTo(totalAvailable) > 0) {
sellerPayoutAmountInputTextField.setText(formattedCounterPartAmount);
} else {
@ -481,7 +485,7 @@ public class DisputeSummaryWindow extends Overlay<DisputeSummaryWindow> {
Coin buyerAmountFromField = ParsingUtils.parseToCoin(buyerPayoutAmountInputTextField.getText(), formatter);
Coin totalAmountFromFields = enteredAmount.add(buyerAmountFromField);
// RefundAgent can enter less then available
if (isMediationDispute ||
if (isMediationDispute() ||
totalAmountFromFields.compareTo(totalAvailable) > 0) {
buyerPayoutAmountInputTextField.setText(formattedCounterPartAmount);
} else {
@ -516,8 +520,13 @@ public class DisputeSummaryWindow extends Overlay<DisputeSummaryWindow> {
VBox vBox = new VBox();
vBox.setSpacing(25);
vBox.getChildren().addAll(hBoxPenalty, hBoxPayouts);
GridPane.setMargin(vBox, new Insets(80, 50, 50, 50));
vBox.setAlignment(Pos.CENTER);
if (isMediationDispute()) {
vBox.getChildren().addAll(hBoxPenalty, hBoxPayouts);
} else {
vBox.getChildren().addAll(hBoxPayouts);
}
GridPane.setMargin(vBox, new Insets(Layout.FLOATING_LABEL_DISTANCE, 50, 0, 50));
GridPane.setRowIndex(vBox, rowIndex);
GridPane.setColumnIndex(vBox, 1);
gridPane.getChildren().add(vBox);
@ -987,11 +996,11 @@ public class DisputeSummaryWindow extends Overlay<DisputeSummaryWindow> {
if (selectedTradeAmountToggle == buyerGetsTradeAmountRadioButton) {
disputeResult.setPayoutSuggestion(DisputeResult.PayoutSuggestion.BUYER_GETS_TRADE_AMOUNT);
disputeResult.setBuyerPayoutAmount(tradeAmount.add(buyerSecurityDeposit));
disputeResult.setSellerPayoutAmount(sellerSecurityDeposit);
disputeResult.setSellerPayoutAmount(isMediationDispute() ? sellerSecurityDeposit : Coin.ZERO);
disputeResult.setPayoutAdjustmentPercent("");
} else if (selectedTradeAmountToggle == sellerGetsTradeAmountRadioButton) {
disputeResult.setPayoutSuggestion(DisputeResult.PayoutSuggestion.SELLER_GETS_TRADE_AMOUNT);
disputeResult.setBuyerPayoutAmount(buyerSecurityDeposit);
disputeResult.setBuyerPayoutAmount(isMediationDispute() ? buyerSecurityDeposit : Coin.ZERO);
disputeResult.setSellerPayoutAmount(tradeAmount.add(sellerSecurityDeposit));
disputeResult.setPayoutAdjustmentPercent("");
} else if (selectedTradeAmountToggle == buyerGetsTradeAmountMinusPenaltyRadioButton) {