Improve logs

Signed-off-by: HenrikJannsen <boilingfrog@gmx.com>
This commit is contained in:
HenrikJannsen 2023-01-05 10:18:42 -05:00
parent 02093b986b
commit f4d335b624
No known key found for this signature in database
GPG Key ID: 02AA2BAE387C8307
2 changed files with 13 additions and 6 deletions

View File

@ -32,7 +32,6 @@ import java.util.List;
import lombok.extern.slf4j.Slf4j;
import static com.google.common.base.Preconditions.checkArgument;
import static com.google.common.base.Preconditions.checkNotNull;
@Slf4j
@ -74,8 +73,13 @@ public class BuyerVerifiesFinalDelayedPayoutTx extends TradeTask {
depositTx,
delayedPayoutTxReceivers,
lockTime);
checkArgument(buyersDelayedPayoutTx.getTxId().equals(finalDelayedPayoutTx.getTxId()),
"TxIds of buyersDelayedPayoutTx and finalDelayedPayoutTx must be the same");
if (!buyersDelayedPayoutTx.getTxId().equals(finalDelayedPayoutTx.getTxId())) {
String errorMsg = "TxIds of buyersDelayedPayoutTx and finalDelayedPayoutTx must be the same.";
log.error("{} \nbuyersDelayedPayoutTx={}, \nfinalDelayedPayoutTx={}",
errorMsg, buyersDelayedPayoutTx, finalDelayedPayoutTx);
throw new IllegalArgumentException(errorMsg);
}
}
complete();

View File

@ -32,7 +32,6 @@ import java.util.List;
import lombok.extern.slf4j.Slf4j;
import static com.google.common.base.Preconditions.checkArgument;
import static com.google.common.base.Preconditions.checkNotNull;
@Slf4j
@ -66,8 +65,12 @@ public class BuyerVerifiesPreparedDelayedPayoutTx extends TradeTask {
preparedDepositTx,
delayedPayoutTxReceivers,
lockTime);
checkArgument(buyersPreparedDelayedPayoutTx.getTxId().equals(sellersPreparedDelayedPayoutTx.getTxId()),
"TxIds of buyersPreparedDelayedPayoutTx and sellersPreparedDelayedPayoutTx must be the same");
if (!buyersPreparedDelayedPayoutTx.getTxId().equals(sellersPreparedDelayedPayoutTx.getTxId())) {
String errorMsg = "TxIds of buyersPreparedDelayedPayoutTx and sellersPreparedDelayedPayoutTx must be the same.";
log.error("{} \nbuyersPreparedDelayedPayoutTx={}, \nsellersPreparedDelayedPayoutTx={}",
errorMsg, buyersPreparedDelayedPayoutTx, sellersPreparedDelayedPayoutTx);
throw new IllegalArgumentException(errorMsg);
}
}
// If the deposit tx is non-malleable, we already know its final ID, so should check that now