diff --git a/core/src/main/java/bisq/core/trade/protocol/tasks/seller/SellerSignAndFinalizePayoutTx.java b/core/src/main/java/bisq/core/trade/protocol/tasks/seller/SellerSignAndFinalizePayoutTx.java index d6868db4238..e947c543fcc 100644 --- a/core/src/main/java/bisq/core/trade/protocol/tasks/seller/SellerSignAndFinalizePayoutTx.java +++ b/core/src/main/java/bisq/core/trade/protocol/tasks/seller/SellerSignAndFinalizePayoutTx.java @@ -35,7 +35,6 @@ import lombok.extern.slf4j.Slf4j; -import static com.google.common.base.Preconditions.checkArgument; import static com.google.common.base.Preconditions.checkNotNull; @Slf4j @@ -70,10 +69,21 @@ protected void run() { final byte[] buyerMultiSigPubKey = tradingPeer.getMultiSigPubKey(); byte[] sellerMultiSigPubKey = processModel.getMyMultiSigPubKey(); - Optional MultiSigAddressEntryOptional = walletService.getAddressEntry(id, AddressEntry.Context.MULTI_SIG); - checkArgument(MultiSigAddressEntryOptional.isPresent() && Arrays.equals(sellerMultiSigPubKey, - MultiSigAddressEntryOptional.get().getPubKey()), - "sellerMultiSigPubKey from AddressEntry must match the one from the trade data. trade id =" + id); + Optional multiSigAddressEntryOptional = walletService.getAddressEntry(id, + AddressEntry.Context.MULTI_SIG); + if (!multiSigAddressEntryOptional.isPresent() || !Arrays.equals(sellerMultiSigPubKey, + multiSigAddressEntryOptional.get().getPubKey())) { + // In some error edge cases it can be that the address entry is not marked (or was unmarked). + // We do not want to fail in that case and only report a warning. + // One case where that helped to avoid a failed payout attempt was when the taker had a power failure + // at the moment when the offer was taken. This caused first to not see step 1 in the trade process + // (all greyed out) but after the deposit tx was confirmed the trade process was on step 2 and + // everything looked ok. At the payout multiSigAddressEntryOptional was not present and payout + // could not be done. By changing the previous behaviour from fail if multiSigAddressEntryOptional + // is not present to only log a warning the payout worked. + log.warn("sellerMultiSigPubKey from AddressEntry does not match the one from the trade data. " + + "Trade id ={}, multiSigAddressEntryOptional={}", id, multiSigAddressEntryOptional); + } DeterministicKey multiSigKeyPair = walletService.getMultiSigKeyPair(id, sellerMultiSigPubKey);