Refactoring: Rename HOTFIX_ACTIVATION_DATE to BUGFIX_6699_ACTIVATION_DATE,

isHotfixActivated to isBugfix6699Activated,
wasHotfixActivatedAtTradeDate to wasBugfix6699ActivatedAtTradeDate

Signed-off-by: HenrikJannsen <boilingfrog@gmx.com>
This commit is contained in:
HenrikJannsen 2023-05-17 12:45:26 +07:00
parent 23156a3286
commit 658a01e5ae
No known key found for this signature in database
GPG Key ID: 02AA2BAE387C8307
2 changed files with 10 additions and 7 deletions

View File

@ -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<Tuple2<Long, String>> getReceivers(int burningManSelectionHeight,
long inputAmount,
long tradeTxFee) {
return getReceivers(burningManSelectionHeight, inputAmount, tradeTxFee, isHotfixActivated());
return getReceivers(burningManSelectionHeight, inputAmount, tradeTxFee, isBugfix6699Activated());
}
public List<Tuple2<Long, String>> getReceivers(int burningManSelectionHeight,
long inputAmount,
long tradeTxFee,
boolean isHotfixActivated) {
boolean isBugfix6699Activated) {
checkArgument(burningManSelectionHeight >= MIN_SNAPSHOT_HEIGHT, "Selection height must be >= " + MIN_SNAPSHOT_HEIGHT);
Collection<BurningManCandidate> burningManCandidates = burningManService.getActiveBurningManCandidates(burningManSelectionHeight);

View File

@ -329,12 +329,12 @@ public final class RefundManager extends DisputeManager<RefundDisputeList> {
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<Tuple2<Long, String>> 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");