From 658a01e5ae9d3d059f9718c9566e97fb2865ef91 Mon Sep 17 00:00:00 2001 From: HenrikJannsen Date: Wed, 17 May 2023 12:45:26 +0700 Subject: [PATCH] Refactoring: Rename HOTFIX_ACTIVATION_DATE to BUGFIX_6699_ACTIVATION_DATE, isHotfixActivated to isBugfix6699Activated, wasHotfixActivatedAtTradeDate to wasBugfix6699ActivatedAtTradeDate Signed-off-by: HenrikJannsen --- .../burningman/DelayedPayoutTxReceiverService.java | 13 ++++++++----- .../core/support/dispute/refund/RefundManager.java | 4 ++-- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/core/src/main/java/bisq/core/dao/burningman/DelayedPayoutTxReceiverService.java b/core/src/main/java/bisq/core/dao/burningman/DelayedPayoutTxReceiverService.java index a410c71d8e..63588e50d9 100644 --- a/core/src/main/java/bisq/core/dao/burningman/DelayedPayoutTxReceiverService.java +++ b/core/src/main/java/bisq/core/dao/burningman/DelayedPayoutTxReceiverService.java @@ -52,10 +52,13 @@ import static com.google.common.base.Preconditions.checkArgument; @Slf4j @Singleton public class DelayedPayoutTxReceiverService implements DaoStateListener { - public static final Date HOTFIX_ACTIVATION_DATE = Utilities.getUTCDate(2023, GregorianCalendar.JANUARY, 10); + // Activation date for bugfix of receiver addresses getting overwritten by a new compensation + // requests change address. + // See: https://github.com/bisq-network/bisq/issues/6699 + public static final Date BUGFIX_6699_ACTIVATION_DATE = Utilities.getUTCDate(2023, GregorianCalendar.AUGUST, 10); - public static boolean isHotfixActivated() { - return new Date().after(HOTFIX_ACTIVATION_DATE); + public static boolean isBugfix6699Activated() { + return new Date().after(BUGFIX_6699_ACTIVATION_DATE); } // We don't allow to get further back than 767950 (the block height from Dec. 18th 2022). @@ -121,13 +124,13 @@ public class DelayedPayoutTxReceiverService implements DaoStateListener { public List> getReceivers(int burningManSelectionHeight, long inputAmount, long tradeTxFee) { - return getReceivers(burningManSelectionHeight, inputAmount, tradeTxFee, isHotfixActivated()); + return getReceivers(burningManSelectionHeight, inputAmount, tradeTxFee, isBugfix6699Activated()); } public List> getReceivers(int burningManSelectionHeight, long inputAmount, long tradeTxFee, - boolean isHotfixActivated) { + boolean isBugfix6699Activated) { checkArgument(burningManSelectionHeight >= MIN_SNAPSHOT_HEIGHT, "Selection height must be >= " + MIN_SNAPSHOT_HEIGHT); Collection burningManCandidates = burningManService.getActiveBurningManCandidates(burningManSelectionHeight); diff --git a/core/src/main/java/bisq/core/support/dispute/refund/RefundManager.java b/core/src/main/java/bisq/core/support/dispute/refund/RefundManager.java index 494ec90fad..d0b417db53 100644 --- a/core/src/main/java/bisq/core/support/dispute/refund/RefundManager.java +++ b/core/src/main/java/bisq/core/support/dispute/refund/RefundManager.java @@ -329,12 +329,12 @@ public final class RefundManager extends DisputeManager { long inputAmount = depositTx.getOutput(0).getValue().value; int selectionHeight = dispute.getBurningManSelectionHeight(); - boolean wasHotfixActivatedAtTradeDate = dispute.getTradeDate().after(DelayedPayoutTxReceiverService.HOTFIX_ACTIVATION_DATE); + boolean wasBugfix6699ActivatedAtTradeDate = dispute.getTradeDate().after(DelayedPayoutTxReceiverService.BUGFIX_6699_ACTIVATION_DATE); List> delayedPayoutTxReceivers = delayedPayoutTxReceiverService.getReceivers( selectionHeight, inputAmount, dispute.getTradeTxFee(), - wasHotfixActivatedAtTradeDate); + wasBugfix6699ActivatedAtTradeDate); log.info("Verify delayedPayoutTx using selectionHeight {} and receivers {}", selectionHeight, delayedPayoutTxReceivers); checkArgument(delayedPayoutTx.getOutputs().size() == delayedPayoutTxReceivers.size(), "Size of outputs and delayedPayoutTxReceivers must be the same");