do not reprocess error on submit multisig tx w/o enough signers #1227

This commit is contained in:
woodser 2024-08-21 10:04:12 -04:00
parent cae360b6c5
commit 2d0f200aa1
3 changed files with 7 additions and 0 deletions

View File

@ -511,6 +511,7 @@ public final class ArbitrationManager extends DisputeManager<ArbitrationDisputeL
break;
} catch (Exception e) {
if (trade.isPayoutPublished()) throw new IllegalStateException("Payout tx already published for " + trade.getClass().getSimpleName() + " " + trade.getShortId());
if (HavenoUtils.isNotEnoughSigners(e)) throw new IllegalArgumentException(e);
log.warn("Failed to submit dispute payout tx, tradeId={}, attempt={}/{}, error={}", trade.getShortId(), i + 1, TradeProtocol.MAX_ATTEMPTS, e.getMessage());
if (i == TradeProtocol.MAX_ATTEMPTS - 1) throw e;
if (trade.getXmrConnectionService().isConnected()) trade.requestSwitchToNextBestConnection(sourceConnection);

View File

@ -521,4 +521,8 @@ public class HavenoUtils {
public static boolean isUnresponsive(Exception e) {
return isConnectionRefused(e) || isReadTimeout(e);
}
public static boolean isNotEnoughSigners(Exception e) {
return e != null && e.getMessage().contains("Not enough signers");
}
}

View File

@ -1381,6 +1381,8 @@ public abstract class Trade extends XmrWalletBase implements Tradable, Model {
wallet.submitMultisigTxHex(payoutTxHex);
setPayoutStatePublished();
} catch (Exception e) {
if (isPayoutPublished()) throw new IllegalStateException("Payout tx already published for " + getClass().getSimpleName() + " " + getShortId());
if (HavenoUtils.isNotEnoughSigners(e)) throw new IllegalArgumentException(e);
throw new RuntimeException("Failed to submit payout tx for " + getClass().getSimpleName() + " " + getId(), e);
}
}