You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// create unsigned dispute payout tx if not already published
938
-
if (!trade.isPayoutPublished()) {
937
+
// check if payout tx already published
938
+
StringalreadyPublishedMsg = "Cannot create dispute payout tx because payout tx is already published for trade " + trade.getId();
939
+
if (trade.isPayoutPublished()) thrownewRuntimeException(alreadyPublishedMsg);
939
940
940
-
// create unsigned dispute payout tx
941
-
if (updateState) log.info("Creating unsigned dispute payout tx for trade {}", trade.getId());
942
-
try {
941
+
// create unsigned dispute payout tx
942
+
if (updateState) log.info("Creating unsigned dispute payout tx for trade {}", trade.getId());
943
+
try {
943
944
944
-
// trade wallet must be synced
945
-
if (trade.getWallet().isMultisigImportNeeded()) thrownewRuntimeException("Arbitrator's wallet needs updated multisig hex to create payout tx which means a trader must have already broadcast the payout tx for trade " + trade.getId());
945
+
// trade wallet must be synced
946
+
if (trade.getWallet().isMultisigImportNeeded()) thrownewRuntimeException("Arbitrator's wallet needs updated multisig hex to create payout tx which means a trader must have already broadcast the payout tx for trade " + trade.getId());
946
947
947
-
// check amounts
948
-
if (disputeResult.getBuyerPayoutAmountBeforeCost().compareTo(BigInteger.ZERO) < 0) thrownewRuntimeException("Buyer payout cannot be negative");
949
-
if (disputeResult.getSellerPayoutAmountBeforeCost().compareTo(BigInteger.ZERO) < 0) thrownewRuntimeException("Seller payout cannot be negative");
950
-
if (disputeResult.getBuyerPayoutAmountBeforeCost().add(disputeResult.getSellerPayoutAmountBeforeCost()).compareTo(trade.getWallet().getUnlockedBalance()) > 0) {
951
-
thrownewRuntimeException("The payout amounts are more than the wallet's unlocked balance, unlocked balance=" + trade.getWallet().getUnlockedBalance() + " vs " + disputeResult.getBuyerPayoutAmountBeforeCost() + " + " + disputeResult.getSellerPayoutAmountBeforeCost() + " = " + (disputeResult.getBuyerPayoutAmountBeforeCost().add(disputeResult.getSellerPayoutAmountBeforeCost())));
952
-
}
948
+
// check amounts
949
+
if (disputeResult.getBuyerPayoutAmountBeforeCost().compareTo(BigInteger.ZERO) < 0) thrownewRuntimeException("Buyer payout cannot be negative");
950
+
if (disputeResult.getSellerPayoutAmountBeforeCost().compareTo(BigInteger.ZERO) < 0) thrownewRuntimeException("Seller payout cannot be negative");
951
+
if (disputeResult.getBuyerPayoutAmountBeforeCost().add(disputeResult.getSellerPayoutAmountBeforeCost()).compareTo(trade.getWallet().getUnlockedBalance()) > 0) {
952
+
thrownewRuntimeException("The payout amounts are more than the wallet's unlocked balance, unlocked balance=" + trade.getWallet().getUnlockedBalance() + " vs " + disputeResult.getBuyerPayoutAmountBeforeCost() + " + " + disputeResult.getSellerPayoutAmountBeforeCost() + " = " + (disputeResult.getBuyerPayoutAmountBeforeCost().add(disputeResult.getSellerPayoutAmountBeforeCost())));
0 commit comments