diff --git a/core/src/main/java/bisq/core/dao/burningman/BtcFeeReceiverService.java b/core/src/main/java/bisq/core/dao/burningman/BtcFeeReceiverService.java index 9134fb95afc..ef927977c63 100644 --- a/core/src/main/java/bisq/core/dao/burningman/BtcFeeReceiverService.java +++ b/core/src/main/java/bisq/core/dao/burningman/BtcFeeReceiverService.java @@ -69,11 +69,6 @@ private void applyBlock(Block block) { /////////////////////////////////////////////////////////////////////////////////////////// public String getAddress() { - if (!BurningManService.isActivated()) { - // Before activation, we fall back to the current fee receiver address - return BurningManPresentationService.LEGACY_BURNING_MAN_BTC_FEES_ADDRESS; - } - List activeBurningManCandidates = new ArrayList<>(burningManService.getActiveBurningManCandidates(currentChainHeight)); if (activeBurningManCandidates.isEmpty()) { // If there are no compensation requests (e.g. at dev testing) we fall back to the default address diff --git a/core/src/main/java/bisq/core/dao/burningman/BurningManService.java b/core/src/main/java/bisq/core/dao/burningman/BurningManService.java index c85f8aff182..f6be313e066 100644 --- a/core/src/main/java/bisq/core/dao/burningman/BurningManService.java +++ b/core/src/main/java/bisq/core/dao/burningman/BurningManService.java @@ -35,9 +35,6 @@ import bisq.network.p2p.storage.P2PDataStorage; -import bisq.common.config.Config; -import bisq.common.util.Utilities; - import javax.inject.Inject; import javax.inject.Singleton; @@ -46,8 +43,6 @@ import com.google.common.collect.ImmutableList; import java.util.Collection; -import java.util.Date; -import java.util.GregorianCalendar; import java.util.HashMap; import java.util.HashSet; import java.util.Map; @@ -67,12 +62,6 @@ @Slf4j @Singleton public class BurningManService { - private static final Date ACTIVATION_DATE = Utilities.getUTCDate(2023, GregorianCalendar.JANUARY, 1); - - public static boolean isActivated() { - return Config.baseCurrencyNetwork().isRegtest() || new Date().after(ACTIVATION_DATE); - } - // Parameters // Cannot be changed after release as it would break trade protocol verification of DPT receivers. diff --git a/core/src/main/java/bisq/core/dao/burningman/accounting/node/AccountingNodeProvider.java b/core/src/main/java/bisq/core/dao/burningman/accounting/node/AccountingNodeProvider.java index 9efff49e2ca..b138067e762 100644 --- a/core/src/main/java/bisq/core/dao/burningman/accounting/node/AccountingNodeProvider.java +++ b/core/src/main/java/bisq/core/dao/burningman/accounting/node/AccountingNodeProvider.java @@ -17,7 +17,6 @@ package bisq.core.dao.burningman.accounting.node; -import bisq.core.dao.burningman.BurningManService; import bisq.core.dao.burningman.accounting.node.full.AccountingFullNode; import bisq.core.dao.burningman.accounting.node.lite.AccountingLiteNode; import bisq.core.user.Preferences; @@ -39,7 +38,6 @@ public class AccountingNodeProvider { @Inject public AccountingNodeProvider(AccountingLiteNode liteNode, AccountingFullNode fullNode, - InActiveAccountingNode inActiveAccountingNode, @Named(Config.IS_BM_FULL_NODE) boolean isBmFullNode, Preferences preferences) { @@ -51,7 +49,7 @@ public AccountingNodeProvider(AccountingLiteNode liteNode, if (isBmFullNode && rpcDataSet) { accountingNode = fullNode; } else { - accountingNode = BurningManService.isActivated() ? liteNode : inActiveAccountingNode; + accountingNode = liteNode; } } } diff --git a/core/src/main/java/bisq/core/dao/burningman/accounting/node/InActiveAccountingNode.java b/core/src/main/java/bisq/core/dao/burningman/accounting/node/InActiveAccountingNode.java deleted file mode 100644 index 7cf7ac6ff71..00000000000 --- a/core/src/main/java/bisq/core/dao/burningman/accounting/node/InActiveAccountingNode.java +++ /dev/null @@ -1,63 +0,0 @@ -/* - * This file is part of Bisq. - * - * Bisq is free software: you can redistribute it and/or modify it - * under the terms of the GNU Affero General Public License as published by - * the Free Software Foundation, either version 3 of the License, or (at - * your option) any later version. - * - * Bisq is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public - * License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with Bisq. If not, see . - */ - -package bisq.core.dao.burningman.accounting.node; - -import bisq.core.dao.burningman.accounting.BurningManAccountingService; -import bisq.core.dao.burningman.accounting.node.full.AccountingBlockParser; -import bisq.core.dao.state.DaoStateService; -import bisq.core.user.Preferences; - -import bisq.network.p2p.P2PService; - -import com.google.inject.Inject; - -import javax.inject.Singleton; - -// Dummy implementation for a do-nothing AccountingNode. Used for the time before the burningman domain gets activated. -@Singleton -class InActiveAccountingNode extends AccountingNode { - @Inject - public InActiveAccountingNode(P2PService p2PService, - DaoStateService daoStateService, - BurningManAccountingService burningManAccountingService, - AccountingBlockParser accountingBlockParser, - Preferences preferences) { - super(p2PService, daoStateService, burningManAccountingService, - accountingBlockParser, preferences); - } - - @Override - public void addListeners() { - } - - @Override - public void start() { - } - - @Override - public void shutDown() { - } - - @Override - protected void onInitialDaoBlockParsingComplete() { - } - - @Override - protected void startRequestBlocks() { - } -} diff --git a/core/src/main/java/bisq/core/offer/OpenOfferManager.java b/core/src/main/java/bisq/core/offer/OpenOfferManager.java index 2e6ac72488c..9d19dae5301 100644 --- a/core/src/main/java/bisq/core/offer/OpenOfferManager.java +++ b/core/src/main/java/bisq/core/offer/OpenOfferManager.java @@ -23,7 +23,6 @@ import bisq.core.btc.wallet.TradeWalletService; import bisq.core.dao.DaoFacade; import bisq.core.dao.burningman.BtcFeeReceiverService; -import bisq.core.dao.burningman.BurningManService; import bisq.core.dao.burningman.DelayedPayoutTxReceiverService; import bisq.core.exceptions.TradePriceOutOfToleranceException; import bisq.core.filter.FilterManager; @@ -745,20 +744,18 @@ private void handleOfferAvailabilityRequest(OfferAvailabilityRequest request, No availabilityResult = AvailabilityResult.UNCONF_TX_LIMIT_HIT; } - if (BurningManService.isActivated()) { - try { - int takersBurningManSelectionHeight = request.getBurningManSelectionHeight(); - checkArgument(takersBurningManSelectionHeight > 0, "takersBurningManSelectionHeight must not be 0"); - - int makersBurningManSelectionHeight = delayedPayoutTxReceiverService.getBurningManSelectionHeight(); - checkArgument(takersBurningManSelectionHeight == makersBurningManSelectionHeight, - "takersBurningManSelectionHeight does no match makersBurningManSelectionHeight. " + - "takersBurningManSelectionHeight=" + takersBurningManSelectionHeight + "; makersBurningManSelectionHeight=" + makersBurningManSelectionHeight); - } catch (Throwable t) { - errorMessage = "Message validation failed. Error=" + t + ", Message=" + request; - log.warn(errorMessage); - availabilityResult = AvailabilityResult.INVALID_SNAPSHOT_HEIGHT; - } + try { + int takersBurningManSelectionHeight = request.getBurningManSelectionHeight(); + checkArgument(takersBurningManSelectionHeight > 0, "takersBurningManSelectionHeight must not be 0"); + + int makersBurningManSelectionHeight = delayedPayoutTxReceiverService.getBurningManSelectionHeight(); + checkArgument(takersBurningManSelectionHeight == makersBurningManSelectionHeight, + "takersBurningManSelectionHeight does no match makersBurningManSelectionHeight. " + + "takersBurningManSelectionHeight=" + takersBurningManSelectionHeight + "; makersBurningManSelectionHeight=" + makersBurningManSelectionHeight); + } catch (Throwable t) { + errorMessage = "Message validation failed. Error=" + t + ", Message=" + request; + log.warn(errorMessage); + availabilityResult = AvailabilityResult.INVALID_SNAPSHOT_HEIGHT; } OfferAvailabilityResponse offerAvailabilityResponse = new OfferAvailabilityResponse(request.offerId, diff --git a/core/src/main/java/bisq/core/trade/protocol/bisq_v1/tasks/buyer/BuyerVerifiesFinalDelayedPayoutTx.java b/core/src/main/java/bisq/core/trade/protocol/bisq_v1/tasks/buyer/BuyerVerifiesFinalDelayedPayoutTx.java index 3bf644b1fdb..97af7cb5c98 100644 --- a/core/src/main/java/bisq/core/trade/protocol/bisq_v1/tasks/buyer/BuyerVerifiesFinalDelayedPayoutTx.java +++ b/core/src/main/java/bisq/core/trade/protocol/bisq_v1/tasks/buyer/BuyerVerifiesFinalDelayedPayoutTx.java @@ -18,7 +18,6 @@ package bisq.core.trade.protocol.bisq_v1.tasks.buyer; import bisq.core.btc.wallet.BtcWalletService; -import bisq.core.dao.burningman.BurningManService; import bisq.core.trade.bisq_v1.TradeDataValidation; import bisq.core.trade.model.bisq_v1.Trade; import bisq.core.trade.protocol.bisq_v1.tasks.TradeTask; @@ -59,33 +58,31 @@ protected void run() { // Now as we know the deposit tx we can also verify the input TradeDataValidation.validatePayoutTxInput(depositTx, finalDelayedPayoutTx); - if (BurningManService.isActivated()) { - long inputAmount = depositTx.getOutput(0).getValue().value; - long tradeTxFeeAsLong = trade.getTradeTxFeeAsLong(); - int selectionHeight = processModel.getBurningManSelectionHeight(); - List> delayedPayoutTxReceivers = processModel.getDelayedPayoutTxReceiverService().getReceivers( - selectionHeight, - inputAmount, - tradeTxFeeAsLong); - log.info("Verify delayedPayoutTx using selectionHeight {} and receivers {}", selectionHeight, delayedPayoutTxReceivers); - long lockTime = trade.getLockTime(); - Transaction buyersDelayedPayoutTx = processModel.getTradeWalletService().createDelayedUnsignedPayoutTx( - depositTx, - delayedPayoutTxReceivers, - lockTime); + long inputAmount = depositTx.getOutput(0).getValue().value; + long tradeTxFeeAsLong = trade.getTradeTxFeeAsLong(); + int selectionHeight = processModel.getBurningManSelectionHeight(); + List> delayedPayoutTxReceivers = processModel.getDelayedPayoutTxReceiverService().getReceivers( + selectionHeight, + inputAmount, + tradeTxFeeAsLong); + log.info("Verify delayedPayoutTx using selectionHeight {} and receivers {}", selectionHeight, delayedPayoutTxReceivers); + long lockTime = trade.getLockTime(); + Transaction buyersDelayedPayoutTx = processModel.getTradeWalletService().createDelayedUnsignedPayoutTx( + depositTx, + delayedPayoutTxReceivers, + lockTime); - if (!buyersDelayedPayoutTx.getTxId().equals(finalDelayedPayoutTx.getTxId())) { - String errorMsg = "TxIds of buyersDelayedPayoutTx and finalDelayedPayoutTx must be the same."; - log.error("{} \nbuyersDelayedPayoutTx={}, \nfinalDelayedPayoutTx={}, " + - "\nBtcWalletService.chainHeight={}, " + - "\nDaoState.chainHeight={}, " + - "\nisDaoStateIsInSync={}", - errorMsg, buyersDelayedPayoutTx, finalDelayedPayoutTx, - processModel.getBtcWalletService().getBestChainHeight(), - processModel.getDaoFacade().getChainHeight(), - processModel.getDaoFacade().isDaoStateReadyAndInSync()); - throw new IllegalArgumentException(errorMsg); - } + if (!buyersDelayedPayoutTx.getTxId().equals(finalDelayedPayoutTx.getTxId())) { + String errorMsg = "TxIds of buyersDelayedPayoutTx and finalDelayedPayoutTx must be the same."; + log.error("{} \nbuyersDelayedPayoutTx={}, \nfinalDelayedPayoutTx={}, " + + "\nBtcWalletService.chainHeight={}, " + + "\nDaoState.chainHeight={}, " + + "\nisDaoStateIsInSync={}", + errorMsg, buyersDelayedPayoutTx, finalDelayedPayoutTx, + processModel.getBtcWalletService().getBestChainHeight(), + processModel.getDaoFacade().getChainHeight(), + processModel.getDaoFacade().isDaoStateReadyAndInSync()); + throw new IllegalArgumentException(errorMsg); } complete(); diff --git a/core/src/main/java/bisq/core/trade/protocol/bisq_v1/tasks/buyer/BuyerVerifiesPreparedDelayedPayoutTx.java b/core/src/main/java/bisq/core/trade/protocol/bisq_v1/tasks/buyer/BuyerVerifiesPreparedDelayedPayoutTx.java index 6fe2321d072..5789f6fa4fa 100644 --- a/core/src/main/java/bisq/core/trade/protocol/bisq_v1/tasks/buyer/BuyerVerifiesPreparedDelayedPayoutTx.java +++ b/core/src/main/java/bisq/core/trade/protocol/bisq_v1/tasks/buyer/BuyerVerifiesPreparedDelayedPayoutTx.java @@ -18,7 +18,6 @@ package bisq.core.trade.protocol.bisq_v1.tasks.buyer; import bisq.core.btc.wallet.BtcWalletService; -import bisq.core.dao.burningman.BurningManService; import bisq.core.trade.bisq_v1.TradeDataValidation; import bisq.core.trade.model.bisq_v1.Trade; import bisq.core.trade.protocol.bisq_v1.tasks.TradeTask; @@ -52,31 +51,29 @@ protected void run() { btcWalletService); Transaction preparedDepositTx = btcWalletService.getTxFromSerializedTx(processModel.getPreparedDepositTx()); - if (BurningManService.isActivated()) { - long inputAmount = preparedDepositTx.getOutput(0).getValue().value; - long tradeTxFeeAsLong = trade.getTradeTxFeeAsLong(); - List> delayedPayoutTxReceivers = processModel.getDelayedPayoutTxReceiverService().getReceivers( - processModel.getBurningManSelectionHeight(), - inputAmount, - tradeTxFeeAsLong); - - long lockTime = trade.getLockTime(); - Transaction buyersPreparedDelayedPayoutTx = processModel.getTradeWalletService().createDelayedUnsignedPayoutTx( - preparedDepositTx, - delayedPayoutTxReceivers, - lockTime); - if (!buyersPreparedDelayedPayoutTx.getTxId().equals(sellersPreparedDelayedPayoutTx.getTxId())) { - String errorMsg = "TxIds of buyersPreparedDelayedPayoutTx and sellersPreparedDelayedPayoutTx must be the same."; - log.error("{} \nbuyersPreparedDelayedPayoutTx={}, \nsellersPreparedDelayedPayoutTx={}, " + - "\nBtcWalletService.chainHeight={}, " + - "\nDaoState.chainHeight={}, " + - "\nisDaoStateIsInSync={}", - errorMsg, buyersPreparedDelayedPayoutTx, sellersPreparedDelayedPayoutTx, - processModel.getBtcWalletService().getBestChainHeight(), - processModel.getDaoFacade().getChainHeight(), - processModel.getDaoFacade().isDaoStateReadyAndInSync()); - throw new IllegalArgumentException(errorMsg); - } + long inputAmount = preparedDepositTx.getOutput(0).getValue().value; + long tradeTxFeeAsLong = trade.getTradeTxFeeAsLong(); + List> delayedPayoutTxReceivers = processModel.getDelayedPayoutTxReceiverService().getReceivers( + processModel.getBurningManSelectionHeight(), + inputAmount, + tradeTxFeeAsLong); + + long lockTime = trade.getLockTime(); + Transaction buyersPreparedDelayedPayoutTx = processModel.getTradeWalletService().createDelayedUnsignedPayoutTx( + preparedDepositTx, + delayedPayoutTxReceivers, + lockTime); + if (!buyersPreparedDelayedPayoutTx.getTxId().equals(sellersPreparedDelayedPayoutTx.getTxId())) { + String errorMsg = "TxIds of buyersPreparedDelayedPayoutTx and sellersPreparedDelayedPayoutTx must be the same."; + log.error("{} \nbuyersPreparedDelayedPayoutTx={}, \nsellersPreparedDelayedPayoutTx={}, " + + "\nBtcWalletService.chainHeight={}, " + + "\nDaoState.chainHeight={}, " + + "\nisDaoStateIsInSync={}", + errorMsg, buyersPreparedDelayedPayoutTx, sellersPreparedDelayedPayoutTx, + processModel.getBtcWalletService().getBestChainHeight(), + processModel.getDaoFacade().getChainHeight(), + processModel.getDaoFacade().isDaoStateReadyAndInSync()); + throw new IllegalArgumentException(errorMsg); } // If the deposit tx is non-malleable, we already know its final ID, so should check that now diff --git a/core/src/main/java/bisq/core/trade/protocol/bisq_v1/tasks/maker/MakerProcessesInputsForDepositTxRequest.java b/core/src/main/java/bisq/core/trade/protocol/bisq_v1/tasks/maker/MakerProcessesInputsForDepositTxRequest.java index aefe9f609ab..395d400893e 100644 --- a/core/src/main/java/bisq/core/trade/protocol/bisq_v1/tasks/maker/MakerProcessesInputsForDepositTxRequest.java +++ b/core/src/main/java/bisq/core/trade/protocol/bisq_v1/tasks/maker/MakerProcessesInputsForDepositTxRequest.java @@ -17,7 +17,6 @@ package bisq.core.trade.protocol.bisq_v1.tasks.maker; -import bisq.core.dao.burningman.BurningManService; import bisq.core.exceptions.TradePriceOutOfToleranceException; import bisq.core.offer.Offer; import bisq.core.support.dispute.mediation.mediator.Mediator; @@ -80,15 +79,13 @@ protected void run() { tradingPeer.setAccountId(nonEmptyStringOf(request.getTakerAccountId())); - if (BurningManService.isActivated()) { - int takersBurningManSelectionHeight = request.getBurningManSelectionHeight(); - checkArgument(takersBurningManSelectionHeight > 0, "takersBurningManSelectionHeight must not be 0"); + int takersBurningManSelectionHeight = request.getBurningManSelectionHeight(); + checkArgument(takersBurningManSelectionHeight > 0, "takersBurningManSelectionHeight must not be 0"); - int makersBurningManSelectionHeight = processModel.getDelayedPayoutTxReceiverService().getBurningManSelectionHeight(); - checkArgument(takersBurningManSelectionHeight == makersBurningManSelectionHeight, - "takersBurningManSelectionHeight does no match makersBurningManSelectionHeight"); - processModel.setBurningManSelectionHeight(makersBurningManSelectionHeight); - } + int makersBurningManSelectionHeight = processModel.getDelayedPayoutTxReceiverService().getBurningManSelectionHeight(); + checkArgument(takersBurningManSelectionHeight == makersBurningManSelectionHeight, + "takersBurningManSelectionHeight does no match makersBurningManSelectionHeight"); + processModel.setBurningManSelectionHeight(makersBurningManSelectionHeight); // We set the taker fee only in the processModel yet not in the trade as the tx was only created but not // published yet. Once it was published we move it to trade. The takerFeeTx should be sent in a later diff --git a/core/src/main/java/bisq/core/trade/protocol/bisq_v1/tasks/seller/SellerCreatesDelayedPayoutTx.java b/core/src/main/java/bisq/core/trade/protocol/bisq_v1/tasks/seller/SellerCreatesDelayedPayoutTx.java index e8d73c365d9..a026a43eb11 100644 --- a/core/src/main/java/bisq/core/trade/protocol/bisq_v1/tasks/seller/SellerCreatesDelayedPayoutTx.java +++ b/core/src/main/java/bisq/core/trade/protocol/bisq_v1/tasks/seller/SellerCreatesDelayedPayoutTx.java @@ -18,8 +18,6 @@ package bisq.core.trade.protocol.bisq_v1.tasks.seller; import bisq.core.btc.wallet.TradeWalletService; -import bisq.core.dao.burningman.BurningManService; -import bisq.core.dao.governance.param.Param; import bisq.core.trade.bisq_v1.TradeDataValidation; import bisq.core.trade.model.bisq_v1.Trade; import bisq.core.trade.protocol.bisq_v1.tasks.TradeTask; @@ -27,7 +25,6 @@ import bisq.common.taskrunner.TaskRunner; import bisq.common.util.Tuple2; -import org.bitcoinj.core.Coin; import org.bitcoinj.core.Transaction; import java.util.List; @@ -51,29 +48,19 @@ protected void run() { TradeWalletService tradeWalletService = processModel.getTradeWalletService(); Transaction depositTx = checkNotNull(processModel.getDepositTx()); Transaction preparedDelayedPayoutTx; - if (BurningManService.isActivated()) { - long inputAmount = depositTx.getOutput(0).getValue().value; - long tradeTxFeeAsLong = trade.getTradeTxFeeAsLong(); - int selectionHeight = processModel.getBurningManSelectionHeight(); - List> delayedPayoutTxReceivers = processModel.getDelayedPayoutTxReceiverService().getReceivers( - selectionHeight, - inputAmount, - tradeTxFeeAsLong); - log.info("Create delayedPayoutTx using selectionHeight {} and receivers {}", selectionHeight, delayedPayoutTxReceivers); - long lockTime = trade.getLockTime(); - preparedDelayedPayoutTx = tradeWalletService.createDelayedUnsignedPayoutTx( - depositTx, - delayedPayoutTxReceivers, - lockTime); - } else { - String donationAddressString = processModel.getDaoFacade().getParamValue(Param.RECIPIENT_BTC_ADDRESS); - Coin minerFee = trade.getTradeTxFee(); - long lockTime = trade.getLockTime(); - preparedDelayedPayoutTx = tradeWalletService.createDelayedUnsignedPayoutTx(depositTx, - donationAddressString, - minerFee, - lockTime); - } + long inputAmount = depositTx.getOutput(0).getValue().value; + long tradeTxFeeAsLong = trade.getTradeTxFeeAsLong(); + int selectionHeight = processModel.getBurningManSelectionHeight(); + List> delayedPayoutTxReceivers = processModel.getDelayedPayoutTxReceiverService().getReceivers( + selectionHeight, + inputAmount, + tradeTxFeeAsLong); + log.info("Create delayedPayoutTx using selectionHeight {} and receivers {}", selectionHeight, delayedPayoutTxReceivers); + long lockTime = trade.getLockTime(); + preparedDelayedPayoutTx = tradeWalletService.createDelayedUnsignedPayoutTx( + depositTx, + delayedPayoutTxReceivers, + lockTime); TradeDataValidation.validateDelayedPayoutTx(trade, preparedDelayedPayoutTx,