diff --git a/assets/src/main/java/bisq/asset/coins/Dash.java b/assets/src/main/java/bisq/asset/coins/Dash.java index 28ca118afc..754c8528b5 100644 --- a/assets/src/main/java/bisq/asset/coins/Dash.java +++ b/assets/src/main/java/bisq/asset/coins/Dash.java @@ -19,11 +19,18 @@ package bisq.asset.coins; import bisq.asset.Base58BitcoinAddressValidator; import bisq.asset.Coin; - -import org.libdohj.params.DashMainNetParams; +import bisq.asset.NetworkParametersAdapter; public class Dash extends Coin { public Dash() { - super("Dash", "DASH", new Base58BitcoinAddressValidator(DashMainNetParams.get()), Network.MAINNET); + super("Dash", "DASH", new Base58BitcoinAddressValidator(new DashMainNetParams()), Network.MAINNET); + } + + public static class DashMainNetParams extends NetworkParametersAdapter { + public DashMainNetParams() { + this.addressHeader = 76; + this.p2shHeader = 16; + this.acceptableAddressCodes = new int[]{this.addressHeader, this.p2shHeader}; + } } } diff --git a/assets/src/main/java/bisq/asset/coins/DeepOnion.java b/assets/src/main/java/bisq/asset/coins/DeepOnion.java index ed5ba25e88..716d1b96da 100644 --- a/assets/src/main/java/bisq/asset/coins/DeepOnion.java +++ b/assets/src/main/java/bisq/asset/coins/DeepOnion.java @@ -22,8 +22,6 @@ import bisq.asset.Base58BitcoinAddressValidator; import bisq.asset.Coin; import bisq.asset.NetworkParametersAdapter; -import org.libdohj.params.DashMainNetParams; - public class DeepOnion extends Coin { public DeepOnion() { super("DeepOnion", "ONION", new DeepOnionAddressValidator()); diff --git a/assets/src/main/java/bisq/asset/coins/Dogecoin.java b/assets/src/main/java/bisq/asset/coins/Dogecoin.java index 159803e1e0..40a500ea52 100644 --- a/assets/src/main/java/bisq/asset/coins/Dogecoin.java +++ b/assets/src/main/java/bisq/asset/coins/Dogecoin.java @@ -19,12 +19,19 @@ package bisq.asset.coins; import bisq.asset.Base58BitcoinAddressValidator; import bisq.asset.Coin; - -import org.libdohj.params.DogecoinMainNetParams; +import bisq.asset.NetworkParametersAdapter; public class Dogecoin extends Coin { public Dogecoin() { - super("Dogecoin", "DOGE", new Base58BitcoinAddressValidator(DogecoinMainNetParams.get())); + super("Dogecoin", "DOGE", new Base58BitcoinAddressValidator(new DogecoinMainNetParams()), Network.MAINNET); + } + + public static class DogecoinMainNetParams extends NetworkParametersAdapter { + public DogecoinMainNetParams() { + this.addressHeader = 30; + this.p2shHeader = 22; + this.acceptableAddressCodes = new int[]{this.addressHeader, this.p2shHeader}; + } } } diff --git a/assets/src/main/java/bisq/asset/coins/Litecoin.java b/assets/src/main/java/bisq/asset/coins/Litecoin.java index 6c2463205d..57b61a3cb5 100644 --- a/assets/src/main/java/bisq/asset/coins/Litecoin.java +++ b/assets/src/main/java/bisq/asset/coins/Litecoin.java @@ -19,11 +19,18 @@ package bisq.asset.coins; import bisq.asset.Base58BitcoinAddressValidator; import bisq.asset.Coin; - -import org.libdohj.params.LitecoinMainNetParams; +import bisq.asset.NetworkParametersAdapter; public class Litecoin extends Coin { public Litecoin() { - super("Litecoin", "LTC", new Base58BitcoinAddressValidator(LitecoinMainNetParams.get()), Network.MAINNET); + super("Litecoin", "LTC", new Base58BitcoinAddressValidator(new LitecoinMainNetParams()), Network.MAINNET); + } + + public static class LitecoinMainNetParams extends NetworkParametersAdapter { + public LitecoinMainNetParams() { + this.addressHeader = 48; + this.p2shHeader = 5; + this.acceptableAddressCodes = new int[]{this.addressHeader, this.p2shHeader}; + } } } diff --git a/build.gradle b/build.gradle index d548e5a3a2..acf90a6e45 100644 --- a/build.gradle +++ b/build.gradle @@ -33,7 +33,6 @@ configure(subprojects) { jmockitVersion = '1.42' joptVersion = '5.0.3' langVersion = '3.4' - libdohjVersion = '7be803fa' bitcoinjVersion = 'cd30ad5b' logbackVersion = '1.1.10' lombokVersion = '1.18.2' @@ -132,10 +131,6 @@ configure([project(':desktop'), configure(project(':assets')) { dependencies { - compile("network.bisq.libdohj:libdohj-core:$libdohjVersion") { - exclude(module: 'protobuf-java') - exclude(module: 'bitcoinj-core') - } compile("com.github.bisq-network.bitcoinj:bitcoinj-core:$bitcoinjVersion") { exclude(module: 'protobuf-java') } @@ -174,11 +169,6 @@ configure(project(':common')) { compile('com.google.inject:guice:4.1.0') { exclude(module: 'guava') } - compile("network.bisq.libdohj:libdohj-core:$libdohjVersion") { - exclude(module: 'slf4j-api') - exclude(module: 'protobuf-java') - exclude(module: 'bitcoinj-core') - } compile("com.github.bisq-network.bitcoinj:bitcoinj-core:$bitcoinjVersion") { exclude(module: 'jsr305') exclude(module: 'slf4j-api') diff --git a/common/src/main/java/bisq/common/Clock.java b/common/src/main/java/bisq/common/Clock.java index 43f990011e..3383b8eba5 100644 --- a/common/src/main/java/bisq/common/Clock.java +++ b/common/src/main/java/bisq/common/Clock.java @@ -21,22 +21,24 @@ import java.util.LinkedList; import java.util.List; import java.util.concurrent.TimeUnit; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; +import lombok.extern.slf4j.Slf4j; // Helps configure listener objects that are run by the `UserThread` each second // and can do per second, per minute and delayed second actions. +@Slf4j public class Clock { - private static final Logger log = LoggerFactory.getLogger(Clock.class); - - public static final int IDLE_TOLERANCE = 20000; + public static final int IDLE_TOLERANCE_MS = 20000; public interface Listener { void onSecondTick(); void onMinuteTick(); - void onMissedSecondTick(long missed); + default void onMissedSecondTick(long missedMs) { + } + + default void onAwakeFromStandby(long missedMs) { + } } private Timer timer; @@ -51,18 +53,24 @@ public class Clock { if (timer == null) { lastSecondTick = System.currentTimeMillis(); timer = UserThread.runPeriodically(() -> { - listeners.stream().forEach(Listener::onSecondTick); + listeners.forEach(Listener::onSecondTick); counter++; if (counter >= 60) { counter = 0; - listeners.stream().forEach(Listener::onMinuteTick); + listeners.forEach(Listener::onMinuteTick); } long currentTimeMillis = System.currentTimeMillis(); long diff = currentTimeMillis - lastSecondTick; - if (diff > 1000) - listeners.stream().forEach(listener -> listener.onMissedSecondTick(diff - 1000)); + if (diff > 1000) { + long missedMs = diff - 1000; + listeners.forEach(listener -> listener.onMissedSecondTick(missedMs)); + if (missedMs > Clock.IDLE_TOLERANCE_MS) { + log.info("We have been in standby mode for {} sec", missedMs / 1000); + listeners.forEach(listener -> listener.onAwakeFromStandby(missedMs)); + } + } lastSecondTick = currentTimeMillis; }, 1, TimeUnit.SECONDS); } diff --git a/core/src/main/java/bisq/core/app/WalletAppSetup.java b/core/src/main/java/bisq/core/app/WalletAppSetup.java index 49237f9095..3bb92a12e9 100644 --- a/core/src/main/java/bisq/core/app/WalletAppSetup.java +++ b/core/src/main/java/bisq/core/app/WalletAppSetup.java @@ -23,8 +23,6 @@ import bisq.core.locale.Res; import bisq.core.user.Preferences; import bisq.core.util.BSFormatter; -import org.libdohj.Version; - import org.bitcoinj.core.VersionMessage; import org.bitcoinj.store.BlockStoreException; import org.bitcoinj.store.ChainFileLockedException; @@ -90,8 +88,8 @@ public class WalletAppSetup { Runnable walletPasswordHandler, Runnable downloadCompleteHandler, Runnable walletInitializedHandler) { - log.info("Initialize WalletAppSetup with BitcoinJ version {} and LibDohJ version {} with hash of BitcoinJ commit {}", - VersionMessage.BITCOINJ_VERSION, Version.VERSION, Version.BITCOINJ_VERSION); + log.info("Initialize WalletAppSetup with BitcoinJ version {} and hash of BitcoinJ commit {}", + VersionMessage.BITCOINJ_VERSION, "cd30ad5b"); ObjectProperty walletServiceException = new SimpleObjectProperty<>(); btcInfoBinding = EasyBind.combine(walletsSetup.downloadPercentageProperty(), diff --git a/core/src/main/java/bisq/core/btc/BaseCurrencyNetwork.java b/core/src/main/java/bisq/core/btc/BaseCurrencyNetwork.java index 51c27f66e0..11138d12a3 100644 --- a/core/src/main/java/bisq/core/btc/BaseCurrencyNetwork.java +++ b/core/src/main/java/bisq/core/btc/BaseCurrencyNetwork.java @@ -17,13 +17,6 @@ package bisq.core.btc; -import org.libdohj.params.DashMainNetParams; -import org.libdohj.params.DashRegTestParams; -import org.libdohj.params.DashTestNet3Params; -import org.libdohj.params.LitecoinMainNetParams; -import org.libdohj.params.LitecoinRegTestParams; -import org.libdohj.params.LitecoinTestNet3Params; - import org.bitcoinj.core.NetworkParameters; import org.bitcoinj.params.MainNetParams; import org.bitcoinj.params.RegTestParams; @@ -34,15 +27,7 @@ import lombok.Getter; public enum BaseCurrencyNetwork { BTC_MAINNET(MainNetParams.get(), "BTC", "MAINNET", "Bitcoin"), BTC_TESTNET(TestNet3Params.get(), "BTC", "TESTNET", "Bitcoin"), - BTC_REGTEST(RegTestParams.get(), "BTC", "REGTEST", "Bitcoin"), - - LTC_MAINNET(LitecoinMainNetParams.get(), "LTC", "MAINNET", "Litecoin"), - LTC_TESTNET(LitecoinTestNet3Params.get(), "LTC", "TESTNET", "Litecoin"), - LTC_REGTEST(LitecoinRegTestParams.get(), "LTC", "REGTEST", "Litecoin"), - - DASH_MAINNET(DashMainNetParams.get(), "DASH", "MAINNET", "Dash"), - DASH_TESTNET(DashTestNet3Params.get(), "DASH", "TESTNET", "Dash"), - DASH_REGTEST(DashRegTestParams.get(), "DASH", "REGTEST", "Dash"); + BTC_REGTEST(RegTestParams.get(), "BTC", "REGTEST", "Bitcoin"); @Getter private final NetworkParameters parameters; @@ -76,14 +61,6 @@ public enum BaseCurrencyNetwork { return "BTC".equals(currencyCode); } - public boolean isLitecoin() { - return "LTC".equals(currencyCode); - } - - public boolean isDash() { - return "DASH".equals(currencyCode); - } - public long getDefaultMinFeePerByte() { return 1; } diff --git a/core/src/main/java/bisq/core/btc/wallet/Restrictions.java b/core/src/main/java/bisq/core/btc/wallet/Restrictions.java index 8d55fadcd3..6bb6590bed 100644 --- a/core/src/main/java/bisq/core/btc/wallet/Restrictions.java +++ b/core/src/main/java/bisq/core/btc/wallet/Restrictions.java @@ -48,83 +48,32 @@ public class Restrictions { public static Coin getMinTradeAmount() { if (MIN_TRADE_AMOUNT == null) - switch (BisqEnvironment.getBaseCurrencyNetwork().getCurrencyCode()) { - case "BTC": - MIN_TRADE_AMOUNT = Coin.valueOf(10_000); // 2 USD @ 20000 USD/BTC - break; - case "LTC": - MIN_TRADE_AMOUNT = Coin.valueOf(100_000); // 0.04 EUR @ 40 EUR/LTC - break; - case "DASH": - MIN_TRADE_AMOUNT = Coin.valueOf(20_000L); // 0.03 EUR at @ 150 EUR/DASH; - break; - } + MIN_TRADE_AMOUNT = Coin.valueOf(10_000); // 2 USD @ 20000 USD/BTC return MIN_TRADE_AMOUNT; } // Can be reduced but not increased. Otherwise would break existing offers! public static Coin getMaxBuyerSecurityDeposit() { if (MAX_BUYER_SECURITY_DEPOSIT == null) - switch (BisqEnvironment.getBaseCurrencyNetwork().getCurrencyCode()) { - case "BTC": - MAX_BUYER_SECURITY_DEPOSIT = Coin.valueOf(5_000_000); // 1000 USD @ 20000 USD/BTC - break; - case "LTC": - MAX_BUYER_SECURITY_DEPOSIT = Coin.valueOf(1_200_000_000); // 500 EUR @ 40 EUR/LTC - break; - case "DASH": - MAX_BUYER_SECURITY_DEPOSIT = Coin.valueOf(300_000_000L); // 450 EUR @ 150 EUR/DASH; - break; - } - + MAX_BUYER_SECURITY_DEPOSIT = Coin.valueOf(5_000_000); // 1000 USD @ 20000 USD/BTC return MAX_BUYER_SECURITY_DEPOSIT; } public static Coin getMinBuyerSecurityDeposit() { if (MIN_BUYER_SECURITY_DEPOSIT == null) - switch (BisqEnvironment.getBaseCurrencyNetwork().getCurrencyCode()) { - case "BTC": - MIN_BUYER_SECURITY_DEPOSIT = Coin.valueOf(50_000); // 10 USD @ 20000 USD/BTC - break; - case "LTC": - MIN_BUYER_SECURITY_DEPOSIT = Coin.valueOf(6_000_000); // 2.4 EUR @ 40 EUR/LTC - break; - case "DASH": - MIN_BUYER_SECURITY_DEPOSIT = Coin.valueOf(1_500_000L); // 2.5 EUR @ 150 EUR/DASH; - break; - } + MIN_BUYER_SECURITY_DEPOSIT = Coin.valueOf(50_000); // 10 USD @ 20000 USD/BTC return MIN_BUYER_SECURITY_DEPOSIT; } public static Coin getDefaultBuyerSecurityDeposit() { if (DEFAULT_BUYER_SECURITY_DEPOSIT == null) - switch (BisqEnvironment.getBaseCurrencyNetwork().getCurrencyCode()) { - case "BTC": - DEFAULT_BUYER_SECURITY_DEPOSIT = Coin.valueOf(1_000_000); // 200 EUR @ 20000 USD/BTC - break; - case "LTC": - DEFAULT_BUYER_SECURITY_DEPOSIT = Coin.valueOf(200_000_000); // 75 EUR @ 40 EUR/LTC - break; - case "DASH": - DEFAULT_BUYER_SECURITY_DEPOSIT = Coin.valueOf(50_000_000L); // 75 EUR @ 150 EUR/DASH; - break; - } + DEFAULT_BUYER_SECURITY_DEPOSIT = Coin.valueOf(1_000_000); // 200 EUR @ 20000 USD/BTC return DEFAULT_BUYER_SECURITY_DEPOSIT; } public static Coin getSellerSecurityDeposit() { if (SELLER_SECURITY_DEPOSIT == null) - switch (BisqEnvironment.getBaseCurrencyNetwork().getCurrencyCode()) { - case "BTC": - SELLER_SECURITY_DEPOSIT = Coin.valueOf(300_000); // 60 USD @ 20000 USD/BTC - break; - case "LTC": - SELLER_SECURITY_DEPOSIT = Coin.valueOf(60_000_000); // 25 EUR @ 40 EUR/LTC - break; - case "DASH": - SELLER_SECURITY_DEPOSIT = Coin.valueOf(15_000_000L); // 25 EUR @ 150 EUR/DASH; - break; - } + SELLER_SECURITY_DEPOSIT = Coin.valueOf(300_000); // 60 USD @ 20000 USD/BTC return SELLER_SECURITY_DEPOSIT; } } diff --git a/core/src/main/java/bisq/core/dao/DaoFacade.java b/core/src/main/java/bisq/core/dao/DaoFacade.java index 1e9ebfb083..149a28c8da 100644 --- a/core/src/main/java/bisq/core/dao/DaoFacade.java +++ b/core/src/main/java/bisq/core/dao/DaoFacade.java @@ -440,7 +440,7 @@ public class DaoFacade implements DaoSetupService { return lastBlock; } - // Because last block in request and voting phases must not be used fo making a tx as it will get confirmed in the + // Because last block in request and voting phases must not be used for making a tx as it will get confirmed in the // next block which would be already the next phase we hide that last block to the user and add it to the break. public int getDurationForPhaseForDisplay(DaoPhase.Phase phase) { int duration = periodService.getDurationForPhase(phase, daoStateService.getChainHeight()); @@ -471,6 +471,10 @@ public class DaoFacade implements DaoSetupService { return duration; } + public int getCurrentCycleDuration() { + return periodService.getCurrentCycle().getDuration(); + } + // listeners for phase change public ReadOnlyObjectProperty phaseProperty() { return phaseProperty; diff --git a/core/src/main/java/bisq/core/dao/governance/proposal/ProposalService.java b/core/src/main/java/bisq/core/dao/governance/proposal/ProposalService.java index 2dfb528e0a..ce5fc6b133 100644 --- a/core/src/main/java/bisq/core/dao/governance/proposal/ProposalService.java +++ b/core/src/main/java/bisq/core/dao/governance/proposal/ProposalService.java @@ -27,6 +27,7 @@ import bisq.core.dao.governance.proposal.storage.temp.TempProposalStorageService import bisq.core.dao.state.DaoStateListener; import bisq.core.dao.state.DaoStateService; import bisq.core.dao.state.model.blockchain.Block; +import bisq.core.dao.state.model.blockchain.Tx; import bisq.core.dao.state.model.governance.DaoPhase; import bisq.core.dao.state.model.governance.Proposal; @@ -47,6 +48,7 @@ import javafx.collections.FXCollections; import javafx.collections.ObservableList; import java.util.List; +import java.util.Optional; import java.util.stream.Collectors; import lombok.Getter; @@ -240,8 +242,11 @@ public class ProposalService implements HashMapChangedListener, AppendOnlyDataSt tempProposals.remove(proposal); } } else { + Optional tx = daoStateService.getTx(proposal.getTxId()); log.warn("We received a remove request outside the PROPOSAL phase. " + - "Proposal.txId={}, blockHeight={}", proposal.getTxId(), daoStateService.getChainHeight()); + "Proposal.txId={}, current blockHeight={}, tx blockHeight={}, proposal creation date={}", + proposal.getTxId(), daoStateService.getChainHeight(), + tx.isPresent() ? tx.get().getBlockHeight() : "null", proposal.getCreationDate()); } } } diff --git a/core/src/main/java/bisq/core/dao/presentation/DaoUtil.java b/core/src/main/java/bisq/core/dao/presentation/DaoUtil.java new file mode 100644 index 0000000000..819b2548e4 --- /dev/null +++ b/core/src/main/java/bisq/core/dao/presentation/DaoUtil.java @@ -0,0 +1,61 @@ +/* + * 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.presentation; + +import bisq.core.dao.DaoFacade; +import bisq.core.dao.state.model.governance.DaoPhase; +import bisq.core.locale.Res; +import bisq.core.util.BSFormatter; + +import java.text.SimpleDateFormat; + +import java.util.Date; +import java.util.Locale; + +/** + * Util class for shared presentation code. + */ +public class DaoUtil { + + public static String getNextPhaseDuration(int height, DaoPhase.Phase phase, DaoFacade daoFacade, BSFormatter formatter) { + final int currentCycleDuration = daoFacade.getCurrentCycleDuration(); + long start = daoFacade.getFirstBlockOfPhaseForDisplay(height, phase) + currentCycleDuration; + long end = daoFacade.getLastBlockOfPhaseForDisplay(height, phase) + currentCycleDuration; + + long now = new Date().getTime(); + SimpleDateFormat dateFormatter = new SimpleDateFormat("dd MMM", Locale.getDefault()); + SimpleDateFormat timeFormatter = new SimpleDateFormat("HH:mm", Locale.getDefault()); + String startDateTime = formatter.formatDateTime(new Date(now + (start - height) * 10 * 60 * 1000L), dateFormatter, timeFormatter); + String endDateTime = formatter.formatDateTime(new Date(now + (end - height) * 10 * 60 * 1000L), dateFormatter, timeFormatter); + + return Res.get("dao.cycle.phaseDurationWithoutBlocks", start, end, startDateTime, endDateTime); + } + + public static String getPhaseDuration(int height, DaoPhase.Phase phase, DaoFacade daoFacade, BSFormatter formatter) { + long start = daoFacade.getFirstBlockOfPhaseForDisplay(height, phase); + long end = daoFacade.getLastBlockOfPhaseForDisplay(height, phase); + long duration = daoFacade.getDurationForPhaseForDisplay(phase); + long now = new Date().getTime(); + SimpleDateFormat dateFormatter = new SimpleDateFormat("dd MMM", Locale.getDefault()); + SimpleDateFormat timeFormatter = new SimpleDateFormat("HH:mm", Locale.getDefault()); + String startDateTime = formatter.formatDateTime(new Date(now + (start - height) * 10 * 60 * 1000L), dateFormatter, timeFormatter); + String endDateTime = formatter.formatDateTime(new Date(now + (end - height) * 10 * 60 * 1000L), dateFormatter, timeFormatter); + String durationTime = formatter.formatDurationAsWords(duration * 10 * 60 * 1000, false, false); + return Res.get("dao.cycle.phaseDuration", duration, durationTime, start, end, startDateTime, endDateTime); + } +} diff --git a/core/src/main/java/bisq/core/network/p2p/seed/DefaultSeedNodeAddresses.java b/core/src/main/java/bisq/core/network/p2p/seed/DefaultSeedNodeAddresses.java index 7c9b4ef7ed..885b016ef8 100644 --- a/core/src/main/java/bisq/core/network/p2p/seed/DefaultSeedNodeAddresses.java +++ b/core/src/main/java/bisq/core/network/p2p/seed/DefaultSeedNodeAddresses.java @@ -42,21 +42,8 @@ class DefaultSeedNodeAddresses { // regtest new NodeAddress("localhost:2002"), - new NodeAddress("localhost:3002"), + new NodeAddress("localhost:3002") /* new NodeAddress("localhost:4002"),*/ - - // LTC - // mainnet - new NodeAddress("localhost:2003"), - - // regtest - new NodeAddress("localhost:2005"), - - // DOGE regtest - new NodeAddress("localhost:2008"), - - // DASH regtest - new NodeAddress("localhost:2011") ); // Addresses are used if their port match the network id: @@ -93,15 +80,8 @@ class DefaultSeedNodeAddresses { // 4. Rename the directory with your local onion address // 5. Edit here your found onion address (new NodeAddress("YOUR_ONION.onion:8002") new NodeAddress("rxdkppp3vicnbgqt.onion:8002"), - new NodeAddress("4ie52dse64kaarxw.onion:8002"), + new NodeAddress("4ie52dse64kaarxw.onion:8002") - // LTC mainnet - new NodeAddress("acyvotgewx46pebw.onion:8003"), - new NodeAddress("pklgy3vdfn3obkur.onion:8003"), - - // DASH mainnet - new NodeAddress("toeu5ikb27ydscxt.onion:8006"), - new NodeAddress("ae4yvaivhnekkhqf.onion:8006") ); private DefaultSeedNodeAddresses() { diff --git a/core/src/main/java/bisq/core/payment/payload/PaymentMethod.java b/core/src/main/java/bisq/core/payment/payload/PaymentMethod.java index d0ad02c3bc..8d72867526 100644 --- a/core/src/main/java/bisq/core/payment/payload/PaymentMethod.java +++ b/core/src/main/java/bisq/core/payment/payload/PaymentMethod.java @@ -168,19 +168,6 @@ public final class PaymentMethod implements PersistablePayload, Comparable { maxTradeLimitLowRisk = Coin.parseCoin("0.5"); maxTradeLimitVeryLowRisk = Coin.parseCoin("1"); break; - case "LTC": - maxTradeLimitHighRisk = Coin.parseCoin("12.5"); - maxTradeLimitMidRisk = Coin.parseCoin("25"); - maxTradeLimitLowRisk = Coin.parseCoin("50"); - maxTradeLimitVeryLowRisk = Coin.parseCoin("100"); - break; - case "DASH": - maxTradeLimitHighRisk = Coin.parseCoin("5"); - maxTradeLimitMidRisk = Coin.parseCoin("10"); - maxTradeLimitLowRisk = Coin.parseCoin("20"); - maxTradeLimitVeryLowRisk = Coin.parseCoin("40"); - break; - default: log.error("Unsupported BaseCurrency. " + BisqEnvironment.getBaseCurrencyNetwork().getCurrencyCode()); throw new RuntimeException("Unsupported BaseCurrency. " + BisqEnvironment.getBaseCurrencyNetwork().getCurrencyCode()); diff --git a/core/src/main/java/bisq/core/provider/fee/FeeProvider.java b/core/src/main/java/bisq/core/provider/fee/FeeProvider.java index f9f1a475b7..ff7a6f8d64 100644 --- a/core/src/main/java/bisq/core/provider/fee/FeeProvider.java +++ b/core/src/main/java/bisq/core/provider/fee/FeeProvider.java @@ -57,12 +57,8 @@ public class FeeProvider extends HttpClientProvider { //noinspection unchecked LinkedTreeMap dataMap = (LinkedTreeMap) linkedTreeMap.get("dataMap"); Long btcTxFee = dataMap.get("btcTxFee").longValue(); - Long ltcTxFee = dataMap.get("ltcTxFee").longValue(); - Long dashTxFee = dataMap.get("dashTxFee").longValue(); map.put("BTC", btcTxFee); - map.put("LTC", ltcTxFee); - map.put("DASH", dashTxFee); } catch (Throwable t) { log.error(t.toString()); t.printStackTrace(); diff --git a/core/src/main/java/bisq/core/trade/TradeManager.java b/core/src/main/java/bisq/core/trade/TradeManager.java index e2b3592197..ee05439a53 100644 --- a/core/src/main/java/bisq/core/trade/TradeManager.java +++ b/core/src/main/java/bisq/core/trade/TradeManager.java @@ -636,10 +636,6 @@ public class TradeManager implements PersistedDataHost { public void onMinuteTick() { updateTradePeriodState(); } - - @Override - public void onMissedSecondTick(long missed) { - } }); } diff --git a/core/src/main/java/bisq/core/user/Preferences.java b/core/src/main/java/bisq/core/user/Preferences.java index b2f442b176..afb3ea2eb8 100644 --- a/core/src/main/java/bisq/core/user/Preferences.java +++ b/core/src/main/java/bisq/core/user/Preferences.java @@ -105,26 +105,6 @@ public final class Preferences implements PersistedDataHost, BridgeAddressProvid public static final BlockChainExplorer BSQ_TEST_NET_EXPLORER = new BlockChainExplorer("BSQ", "https://explorer.bisq.network/testnet/tx.html?tx=", "https://explorer.bisq.network/testnet/Address.html?addr="); - private static final ArrayList LTC_MAIN_NET_EXPLORERS = new ArrayList<>(Arrays.asList( - new BlockChainExplorer("Blockcypher", "https://live.blockcypher.com/ltc/tx/", "https://live.blockcypher.com/ltc/address/"), - new BlockChainExplorer("CryptoID", "https://chainz.cryptoid.info/ltc/tx.dws?", "https://chainz.cryptoid.info/ltc/address.dws?"), - new BlockChainExplorer("Abe Search", "http://explorer.litecoin.net/tx/", "http://explorer.litecoin.net/address/"), - new BlockChainExplorer("SoChain", "https://chain.so/tx/LTC/", "https://chain.so/address/LTC/"), - new BlockChainExplorer("Blockr.io", "http://ltc.blockr.io/tx/info/", "http://ltc.blockr.io/address/info/") - )); - - private static final ArrayList LTC_TEST_NET_EXPLORERS = new ArrayList<>(Arrays.asList( - new BlockChainExplorer("SoChain", "https://chain.so/tx/LTCTEST/", "https://chain.so/address/LTCTEST/") - )); - - private static final ArrayList DASH_MAIN_NET_EXPLORERS = new ArrayList<>(Arrays.asList( - new BlockChainExplorer("SoChain", "https://chain.so/tx/dash/", "https://chain.so/address/dash/") - )); - private static final ArrayList DASH_TEST_NET_EXPLORERS = new ArrayList<>(Arrays.asList( - new BlockChainExplorer("SoChain", "https://chain.so/tx/DASHTEST/", "https://chain.so/address/DASHTEST/") - )); - - // payload is initialized so the default values are available for Property initialization. @Setter @Delegate(excludes = ExcludesDelegateMethods.class) @@ -243,14 +223,6 @@ public final class Preferences implements PersistedDataHost, BridgeAddressProvid setBlockChainExplorerMainNet(BTC_MAIN_NET_EXPLORERS.get(0)); setBlockChainExplorerTestNet(BTC_TEST_NET_EXPLORERS.get(0)); break; - case "LTC": - setBlockChainExplorerMainNet(LTC_MAIN_NET_EXPLORERS.get(0)); - setBlockChainExplorerTestNet(LTC_TEST_NET_EXPLORERS.get(0)); - break; - case "DASH": - setBlockChainExplorerMainNet(DASH_MAIN_NET_EXPLORERS.get(0)); - setBlockChainExplorerTestNet(DASH_TEST_NET_EXPLORERS.get(0)); - break; default: throw new RuntimeException("BaseCurrencyNetwork not defined. BaseCurrencyNetwork=" + baseCurrencyNetwork); } @@ -672,16 +644,6 @@ public final class Preferences implements PersistedDataHost, BridgeAddressProvid case BTC_TESTNET: case BTC_REGTEST: return BTC_TEST_NET_EXPLORERS; - case LTC_MAINNET: - return LTC_MAIN_NET_EXPLORERS; - case LTC_TESTNET: - case LTC_REGTEST: - return LTC_TEST_NET_EXPLORERS; - case DASH_MAINNET: - return DASH_MAIN_NET_EXPLORERS; - case DASH_REGTEST: - case DASH_TESTNET: - return DASH_TEST_NET_EXPLORERS; default: throw new RuntimeException("BaseCurrencyNetwork not defined. BaseCurrencyNetwork=" + baseCurrencyNetwork); } diff --git a/core/src/main/java/bisq/core/util/BsqFormatter.java b/core/src/main/java/bisq/core/util/BsqFormatter.java index 92a91b3cf5..3b04bb1c5b 100644 --- a/core/src/main/java/bisq/core/util/BsqFormatter.java +++ b/core/src/main/java/bisq/core/util/BsqFormatter.java @@ -66,13 +66,6 @@ public class BsqFormatter extends BSFormatter { case "BTC": coinFormat = new MonetaryFormat().shift(6).code(6, "BSQ").minDecimals(2); break; - case "LTC": - coinFormat = new MonetaryFormat().shift(3).code(3, "BSQ").minDecimals(5); - break; - case "DASH": - // BSQ for DASH not used/supported - coinFormat = new MonetaryFormat().shift(3).code(3, "???").minDecimals(5); - break; default: throw new RuntimeException("baseCurrencyCode not defined. baseCurrencyCode=" + baseCurrencyCode); } diff --git a/core/src/main/resources/i18n/displayStrings.properties b/core/src/main/resources/i18n/displayStrings.properties index 689266c42a..f38e3cbb9b 100644 --- a/core/src/main/resources/i18n/displayStrings.properties +++ b/core/src/main/resources/i18n/displayStrings.properties @@ -1205,10 +1205,12 @@ dao.cycle.overview.headline=Voting cycle overview dao.cycle.currentPhase=Current phase dao.cycle.currentBlockHeight=Current block height dao.cycle.proposal=Proposal phase +dao.cycle.proposal.next=Next proposal phase dao.cycle.blindVote=Blind vote phase dao.cycle.voteReveal=Vote reveal phase dao.cycle.voteResult=Vote result dao.cycle.phaseDuration={0} blocks (≈{1}); Block {2} - {3} (≈{4} - ≈{5}) +dao.cycle.phaseDurationWithoutBlocks=Block {0} - {1} (≈{2} - ≈{3}) dao.voteReveal.txPublished.headLine=Vote reveal transaction published dao.voteReveal.txPublished=Your vote reveal transaction with transaction ID {0} was successfully published.\n\n\ @@ -1575,6 +1577,7 @@ dao.proposal.votes.header=Vote on all proposals dao.proposal.votes.header.voted=My vote dao.proposal.myVote.button=Vote on all proposals dao.proposal.create.selectProposalType=Select proposal type +dao.proposal.create.phase.inactive=Please wait until the next proposal phase dao.proposal.create.proposalType=Proposal type dao.proposal.create.createNew=Make new proposal dao.proposal.create.create.button=Make proposal @@ -2204,19 +2207,6 @@ BTC_TESTNET=Bitcoin Testnet # suppress inspection "UnusedProperty" BTC_REGTEST=Bitcoin Regtest -# suppress inspection "UnusedProperty" -LTC_MAINNET=Litecoin Mainnet -# suppress inspection "UnusedProperty" -LTC_TESTNET=Litecoin Testnet -# suppress inspection "UnusedProperty" -LTC_REGTEST=Litecoin Regtest -# suppress inspection "UnusedProperty" -DASH_MAINNET=DASH Mainnet -# suppress inspection "UnusedProperty" -DASH_TESTNET=DASH Testnet -# suppress inspection "UnusedProperty" -DASH_REGTEST=DASH Regtest - time.year=Year time.month=Month time.week=Week diff --git a/core/src/main/resources/i18n/displayStrings_de.properties b/core/src/main/resources/i18n/displayStrings_de.properties index 018b607114..2341ab680a 100644 --- a/core/src/main/resources/i18n/displayStrings_de.properties +++ b/core/src/main/resources/i18n/displayStrings_de.properties @@ -1956,19 +1956,6 @@ BTC_TESTNET=Bitcoin-Testnetzwerk # suppress inspection "UnusedProperty" BTC_REGTEST=Bitcoin-Regtest -# suppress inspection "UnusedProperty" -LTC_MAINNET=Litecoin-Hauptnetzwerk -# suppress inspection "UnusedProperty" -LTC_TESTNET=Litecoin-Testnetzwerk -# suppress inspection "UnusedProperty" -LTC_REGTEST=Litecoin-Regtest -# suppress inspection "UnusedProperty" -DASH_MAINNET=DASH-Hauptnetz -# suppress inspection "UnusedProperty" -DASH_TESTNET=DASH Testnet -# suppress inspection "UnusedProperty" -DASH_REGTEST=DASH Regtest - time.year=Jahr time.month=Monat time.week=Woche diff --git a/core/src/main/resources/i18n/displayStrings_el.properties b/core/src/main/resources/i18n/displayStrings_el.properties index 791fb41f63..2be56d9268 100644 --- a/core/src/main/resources/i18n/displayStrings_el.properties +++ b/core/src/main/resources/i18n/displayStrings_el.properties @@ -1956,19 +1956,6 @@ BTC_TESTNET=Bitcoin Testnet # suppress inspection "UnusedProperty" BTC_REGTEST=Bitcoin Regtest -# suppress inspection "UnusedProperty" -LTC_MAINNET=Litecoin Mainnet -# suppress inspection "UnusedProperty" -LTC_TESTNET=Litecoin Testnet -# suppress inspection "UnusedProperty" -LTC_REGTEST=Litecoin Regtest -# suppress inspection "UnusedProperty" -DASH_MAINNET=DASH Mainnet -# suppress inspection "UnusedProperty" -DASH_TESTNET=DASH Testnet -# suppress inspection "UnusedProperty" -DASH_REGTEST=DASH Regtest - time.year=Έτος time.month=Μήνας time.week=Εβδομάδα diff --git a/core/src/main/resources/i18n/displayStrings_es.properties b/core/src/main/resources/i18n/displayStrings_es.properties index 9585f8567d..2ac12a805f 100644 --- a/core/src/main/resources/i18n/displayStrings_es.properties +++ b/core/src/main/resources/i18n/displayStrings_es.properties @@ -1956,19 +1956,6 @@ BTC_TESTNET=Red de prueba de Bitcoin # suppress inspection "UnusedProperty" BTC_REGTEST=Regtest Bitcoin -# suppress inspection "UnusedProperty" -LTC_MAINNET=Red principal de Litecoin -# suppress inspection "UnusedProperty" -LTC_TESTNET=Testnet Litecoin -# suppress inspection "UnusedProperty" -LTC_REGTEST=Regtest Litecoin -# suppress inspection "UnusedProperty" -DASH_MAINNET=Red principal DASH -# suppress inspection "UnusedProperty" -DASH_TESTNET=Testnet DASH -# suppress inspection "UnusedProperty" -DASH_REGTEST=Regtest DASH - time.year=Año time.month=Mes time.week=Semana diff --git a/core/src/main/resources/i18n/displayStrings_fa.properties b/core/src/main/resources/i18n/displayStrings_fa.properties index 672af9be47..6ff109c0e3 100644 --- a/core/src/main/resources/i18n/displayStrings_fa.properties +++ b/core/src/main/resources/i18n/displayStrings_fa.properties @@ -1956,19 +1956,6 @@ BTC_TESTNET=Bitcoin Testnet # suppress inspection "UnusedProperty" BTC_REGTEST=Bitcoin Regtest -# suppress inspection "UnusedProperty" -LTC_MAINNET=Litecoin Mainnet -# suppress inspection "UnusedProperty" -LTC_TESTNET=Litecoin Testnet -# suppress inspection "UnusedProperty" -LTC_REGTEST=Litecoin Regtest -# suppress inspection "UnusedProperty" -DASH_MAINNET=DASH Mainnet -# suppress inspection "UnusedProperty" -DASH_TESTNET=DASH Testnet -# suppress inspection "UnusedProperty" -DASH_REGTEST=DASH Regtest - time.year=سال time.month=ماه time.week=هفته diff --git a/core/src/main/resources/i18n/displayStrings_fr.properties b/core/src/main/resources/i18n/displayStrings_fr.properties index 6ec7a5220e..89ddff9467 100644 --- a/core/src/main/resources/i18n/displayStrings_fr.properties +++ b/core/src/main/resources/i18n/displayStrings_fr.properties @@ -1956,19 +1956,6 @@ BTC_TESTNET=Bitcoin Testnet # suppress inspection "UnusedProperty" BTC_REGTEST=Bitcoin Regtest -# suppress inspection "UnusedProperty" -LTC_MAINNET=Litecoin Mainnet -# suppress inspection "UnusedProperty" -LTC_TESTNET=Litecoin Testnet -# suppress inspection "UnusedProperty" -LTC_REGTEST=Litecoin Regtest -# suppress inspection "UnusedProperty" -DASH_MAINNET=DASH Mainnet -# suppress inspection "UnusedProperty" -DASH_TESTNET=DASH Testnet -# suppress inspection "UnusedProperty" -DASH_REGTEST=DASH Regtest - time.year=Année time.month=Mois time.week=Semaine diff --git a/core/src/main/resources/i18n/displayStrings_hu.properties b/core/src/main/resources/i18n/displayStrings_hu.properties index 037e9db8af..ea94dedacb 100644 --- a/core/src/main/resources/i18n/displayStrings_hu.properties +++ b/core/src/main/resources/i18n/displayStrings_hu.properties @@ -1956,19 +1956,6 @@ BTC_TESTNET=Bitcoin Testnet # suppress inspection "UnusedProperty" BTC_REGTEST=Bitcoin Regtest -# suppress inspection "UnusedProperty" -LTC_MAINNET=Litecoin Mainnet -# suppress inspection "UnusedProperty" -LTC_TESTNET=Litecoin Testnet -# suppress inspection "UnusedProperty" -LTC_REGTEST=Litecoin Regtest -# suppress inspection "UnusedProperty" -DASH_MAINNET=DASH főhálozat -# suppress inspection "UnusedProperty" -DASH_TESTNET=DASH Teszthálozat -# suppress inspection "UnusedProperty" -DASH_REGTEST=DASH Regtest - time.year=Év time.month=Hónap time.week=Hét diff --git a/core/src/main/resources/i18n/displayStrings_pt.properties b/core/src/main/resources/i18n/displayStrings_pt.properties index 2f2fc18169..8c8ef579bc 100644 --- a/core/src/main/resources/i18n/displayStrings_pt.properties +++ b/core/src/main/resources/i18n/displayStrings_pt.properties @@ -1956,19 +1956,6 @@ BTC_TESTNET=Testnet do Bitcoin # suppress inspection "UnusedProperty" BTC_REGTEST=Regtest do Bitcoin -# suppress inspection "UnusedProperty" -LTC_MAINNET=Mainnet da Litecoin -# suppress inspection "UnusedProperty" -LTC_TESTNET=Testnet da Litecoin -# suppress inspection "UnusedProperty" -LTC_REGTEST=Regtest da Litecoin -# suppress inspection "UnusedProperty" -DASH_MAINNET=Mainnet da DASH -# suppress inspection "UnusedProperty" -DASH_TESTNET=Testnet do DASH -# suppress inspection "UnusedProperty" -DASH_REGTEST=Regtest do DASH - time.year=Ano time.month=Mês time.week=Semana diff --git a/core/src/main/resources/i18n/displayStrings_ro.properties b/core/src/main/resources/i18n/displayStrings_ro.properties index d3183e4b3f..478d0df7e1 100644 --- a/core/src/main/resources/i18n/displayStrings_ro.properties +++ b/core/src/main/resources/i18n/displayStrings_ro.properties @@ -1956,19 +1956,6 @@ BTC_TESTNET=Bitcoin Testnet # suppress inspection "UnusedProperty" BTC_REGTEST=Bitcoin Regtest -# suppress inspection "UnusedProperty" -LTC_MAINNET=Litecoin Mainnet -# suppress inspection "UnusedProperty" -LTC_TESTNET=Litecoin Testnet -# suppress inspection "UnusedProperty" -LTC_REGTEST=Litecoin Regtest -# suppress inspection "UnusedProperty" -DASH_MAINNET=Rețeaua principală DASH -# suppress inspection "UnusedProperty" -DASH_TESTNET=Rețeaua de test DASH -# suppress inspection "UnusedProperty" -DASH_REGTEST=DASH Regtest - time.year=An time.month=Lună time.week=Săptămână diff --git a/core/src/main/resources/i18n/displayStrings_ru.properties b/core/src/main/resources/i18n/displayStrings_ru.properties index 2335b6b9c4..c20b37285a 100644 --- a/core/src/main/resources/i18n/displayStrings_ru.properties +++ b/core/src/main/resources/i18n/displayStrings_ru.properties @@ -1956,19 +1956,6 @@ BTC_TESTNET=Биткойн Тест-сеть # suppress inspection "UnusedProperty" BTC_REGTEST=Биткойн режим регрессионного тестирования -# suppress inspection "UnusedProperty" -LTC_MAINNET=Litecoin Основная сеть -# suppress inspection "UnusedProperty" -LTC_TESTNET=Litecoin Тест-сеть -# suppress inspection "UnusedProperty" -LTC_REGTEST=Litecoin Регистр.-тест -# suppress inspection "UnusedProperty" -DASH_MAINNET=DASH Mainnet -# suppress inspection "UnusedProperty" -DASH_TESTNET=DASH Testnet -# suppress inspection "UnusedProperty" -DASH_REGTEST=DASH Regtest - time.year=Год time.month=Месяц time.week=Неделя diff --git a/core/src/main/resources/i18n/displayStrings_sr.properties b/core/src/main/resources/i18n/displayStrings_sr.properties index 5fc783659d..660aacea28 100644 --- a/core/src/main/resources/i18n/displayStrings_sr.properties +++ b/core/src/main/resources/i18n/displayStrings_sr.properties @@ -1956,19 +1956,6 @@ BTC_TESTNET=Bitkoin Testnet # suppress inspection "UnusedProperty" BTC_REGTEST=Bitkoin Regtest -# suppress inspection "UnusedProperty" -LTC_MAINNET=Lajtkoin Mejnnet -# suppress inspection "UnusedProperty" -LTC_TESTNET=Lajtkoin Testnet -# suppress inspection "UnusedProperty" -LTC_REGTEST=Lajtkoin Regtest -# suppress inspection "UnusedProperty" -DASH_MAINNET=DASH Mainnet -# suppress inspection "UnusedProperty" -DASH_TESTNET=DASH Testnet -# suppress inspection "UnusedProperty" -DASH_REGTEST=DASH Regtest - time.year=Godina time.month=Mesec time.week=Nedelja diff --git a/core/src/main/resources/i18n/displayStrings_th.properties b/core/src/main/resources/i18n/displayStrings_th.properties index f9624671b2..2d92d770db 100644 --- a/core/src/main/resources/i18n/displayStrings_th.properties +++ b/core/src/main/resources/i18n/displayStrings_th.properties @@ -1956,19 +1956,6 @@ BTC_TESTNET=Bitcoin Testnet # suppress inspection "UnusedProperty" BTC_REGTEST=Bitcoin Regtest -# suppress inspection "UnusedProperty" -LTC_MAINNET=Litecoin Mainnet -# suppress inspection "UnusedProperty" -LTC_TESTNET=Litecoin Testnet -# suppress inspection "UnusedProperty" -LTC_REGTEST=Litecoin Regtest -# suppress inspection "UnusedProperty" -DASH_MAINNET=DASH Mainnet -# suppress inspection "UnusedProperty" -DASH_TESTNET=DASH Testnet -# suppress inspection "UnusedProperty" -DASH_REGTEST=DASH Regtest - time.year=ปี time.month=เดือน time.week=สัปดาห์ diff --git a/core/src/main/resources/i18n/displayStrings_vi.properties b/core/src/main/resources/i18n/displayStrings_vi.properties index f1d054acef..911c7454d7 100644 --- a/core/src/main/resources/i18n/displayStrings_vi.properties +++ b/core/src/main/resources/i18n/displayStrings_vi.properties @@ -1956,19 +1956,6 @@ BTC_TESTNET=Bitcoin Testnet # suppress inspection "UnusedProperty" BTC_REGTEST=Bitcoin Regtest -# suppress inspection "UnusedProperty" -LTC_MAINNET=Litecoin Mainnet -# suppress inspection "UnusedProperty" -LTC_TESTNET=Litecoin Testnet -# suppress inspection "UnusedProperty" -LTC_REGTEST=Litecoin Regtest -# suppress inspection "UnusedProperty" -DASH_MAINNET=DASH Mainnet -# suppress inspection "UnusedProperty" -DASH_TESTNET=DASH Testnet -# suppress inspection "UnusedProperty" -DASH_REGTEST=DASH Regtest - time.year=Năm time.month=Tháng time.week=Tuần diff --git a/core/src/main/resources/i18n/displayStrings_zh.properties b/core/src/main/resources/i18n/displayStrings_zh.properties index 865ee58beb..0ea735e05a 100644 --- a/core/src/main/resources/i18n/displayStrings_zh.properties +++ b/core/src/main/resources/i18n/displayStrings_zh.properties @@ -1956,19 +1956,6 @@ BTC_TESTNET=比特币测试网络 # suppress inspection "UnusedProperty" BTC_REGTEST=比特币回归测试 -# suppress inspection "UnusedProperty" -LTC_MAINNET=莱特币主干网络 -# suppress inspection "UnusedProperty" -LTC_TESTNET=莱特币测试网络 -# suppress inspection "UnusedProperty" -LTC_REGTEST=莱特币回归测试 -# suppress inspection "UnusedProperty" -DASH_MAINNET=达世币主干网络 -# suppress inspection "UnusedProperty" -DASH_TESTNET=达世币测试网络 -# suppress inspection "UnusedProperty" -DASH_REGTEST=达世币回归测试 - time.year=年线 time.month=月线 time.week=周线 diff --git a/desktop/src/main/java/bisq/desktop/main/dao/governance/dashboard/GovernanceDashboardView.java b/desktop/src/main/java/bisq/desktop/main/dao/governance/dashboard/GovernanceDashboardView.java index d31d1fa4a8..c2a997282b 100644 --- a/desktop/src/main/java/bisq/desktop/main/dao/governance/dashboard/GovernanceDashboardView.java +++ b/desktop/src/main/java/bisq/desktop/main/dao/governance/dashboard/GovernanceDashboardView.java @@ -20,11 +20,11 @@ package bisq.desktop.main.dao.governance.dashboard; import bisq.desktop.common.view.ActivatableView; import bisq.desktop.common.view.FxmlView; import bisq.desktop.main.dao.governance.PhasesView; -import bisq.desktop.util.FormBuilder; import bisq.desktop.util.Layout; import bisq.core.dao.DaoFacade; import bisq.core.dao.governance.period.PeriodService; +import bisq.core.dao.presentation.DaoUtil; import bisq.core.dao.state.DaoStateListener; import bisq.core.dao.state.model.blockchain.Block; import bisq.core.dao.state.model.governance.DaoPhase; @@ -36,11 +36,6 @@ import javax.inject.Inject; import javafx.scene.control.TextField; import javafx.scene.layout.GridPane; -import java.text.SimpleDateFormat; - -import java.util.Date; -import java.util.Locale; - import static bisq.desktop.util.FormBuilder.addTitledGroupBg; import static bisq.desktop.util.FormBuilder.addTopLabelReadOnlyTextField; @@ -77,11 +72,11 @@ public class GovernanceDashboardView extends ActivatableView imp addTitledGroupBg(root, ++gridRow, 6, Res.get("dao.cycle.overview.headline"), Layout.GROUP_DISTANCE); currentBlockHeightTextField = addTopLabelReadOnlyTextField(root, gridRow, Res.get("dao.cycle.currentBlockHeight"), Layout.FIRST_ROW_AND_GROUP_DISTANCE).second; - currentPhaseTextField = FormBuilder.addTopLabelReadOnlyTextField(root, ++gridRow, Res.get("dao.cycle.currentPhase")).second; - proposalTextField = FormBuilder.addTopLabelReadOnlyTextField(root, ++gridRow, Res.get("dao.cycle.proposal")).second; - blindVoteTextField = FormBuilder.addTopLabelReadOnlyTextField(root, ++gridRow, Res.get("dao.cycle.blindVote")).second; - voteRevealTextField = FormBuilder.addTopLabelReadOnlyTextField(root, ++gridRow, Res.get("dao.cycle.voteReveal")).second; - voteResultTextField = FormBuilder.addTopLabelReadOnlyTextField(root, ++gridRow, Res.get("dao.cycle.voteResult")).second; + currentPhaseTextField = addTopLabelReadOnlyTextField(root, ++gridRow, Res.get("dao.cycle.currentPhase")).second; + proposalTextField = addTopLabelReadOnlyTextField(root, ++gridRow, Res.get("dao.cycle.proposal")).second; + blindVoteTextField = addTopLabelReadOnlyTextField(root, ++gridRow, Res.get("dao.cycle.blindVote")).second; + voteRevealTextField = addTopLabelReadOnlyTextField(root, ++gridRow, Res.get("dao.cycle.voteReveal")).second; + voteResultTextField = addTopLabelReadOnlyTextField(root, ++gridRow, Res.get("dao.cycle.voteResult")).second; } @Override @@ -128,22 +123,9 @@ public class GovernanceDashboardView extends ActivatableView imp phase = periodService.getPhaseForHeight(height + 1); } currentPhaseTextField.setText(Res.get("dao.phase." + phase.name())); - proposalTextField.setText(getPhaseDuration(height, DaoPhase.Phase.PROPOSAL)); - blindVoteTextField.setText(getPhaseDuration(height, DaoPhase.Phase.BLIND_VOTE)); - voteRevealTextField.setText(getPhaseDuration(height, DaoPhase.Phase.VOTE_REVEAL)); - voteResultTextField.setText(getPhaseDuration(height, DaoPhase.Phase.RESULT)); - } - - private String getPhaseDuration(int height, DaoPhase.Phase phase) { - long start = daoFacade.getFirstBlockOfPhaseForDisplay(height, phase); - long end = daoFacade.getLastBlockOfPhaseForDisplay(height, phase); - long duration = daoFacade.getDurationForPhaseForDisplay(phase); - long now = new Date().getTime(); - SimpleDateFormat dateFormatter = new SimpleDateFormat("dd MMM", Locale.getDefault()); - SimpleDateFormat timeFormatter = new SimpleDateFormat("HH:mm", Locale.getDefault()); - String startDateTime = formatter.formatDateTime(new Date(now + (start - height) * 10 * 60 * 1000L), dateFormatter, timeFormatter); - String endDateTime = formatter.formatDateTime(new Date(now + (end - height) * 10 * 60 * 1000L), dateFormatter, timeFormatter); - String durationTime = formatter.formatDurationAsWords(duration * 10 * 60 * 1000, false, false); - return Res.get("dao.cycle.phaseDuration", duration, durationTime, start, end, startDateTime, endDateTime); + proposalTextField.setText(DaoUtil.getPhaseDuration(height, DaoPhase.Phase.PROPOSAL, daoFacade, formatter)); + blindVoteTextField.setText(DaoUtil.getPhaseDuration(height, DaoPhase.Phase.BLIND_VOTE, daoFacade, formatter)); + voteRevealTextField.setText(DaoUtil.getPhaseDuration(height, DaoPhase.Phase.VOTE_REVEAL, daoFacade, formatter)); + voteResultTextField.setText(DaoUtil.getPhaseDuration(height, DaoPhase.Phase.RESULT, daoFacade, formatter)); } } diff --git a/desktop/src/main/java/bisq/desktop/main/dao/governance/make/MakeProposalView.java b/desktop/src/main/java/bisq/desktop/main/dao/governance/make/MakeProposalView.java index 1583a196fb..fb998118a8 100644 --- a/desktop/src/main/java/bisq/desktop/main/dao/governance/make/MakeProposalView.java +++ b/desktop/src/main/java/bisq/desktop/main/dao/governance/make/MakeProposalView.java @@ -21,10 +21,10 @@ import bisq.desktop.Navigation; import bisq.desktop.common.view.ActivatableView; import bisq.desktop.common.view.FxmlView; import bisq.desktop.components.InputTextField; +import bisq.desktop.components.TitledGroupBg; import bisq.desktop.main.dao.governance.PhasesView; import bisq.desktop.main.dao.governance.ProposalDisplay; import bisq.desktop.main.overlays.popups.Popup; -import bisq.desktop.util.FormBuilder; import bisq.desktop.util.GUIUtil; import bisq.desktop.util.Layout; @@ -38,6 +38,7 @@ import bisq.core.dao.governance.proposal.ProposalType; import bisq.core.dao.governance.proposal.ProposalWithTransaction; import bisq.core.dao.governance.proposal.TxException; import bisq.core.dao.governance.proposal.param.ChangeParamValidator; +import bisq.core.dao.presentation.DaoUtil; import bisq.core.dao.state.DaoStateListener; import bisq.core.dao.state.model.blockchain.Block; import bisq.core.dao.state.model.governance.DaoPhase; @@ -52,6 +53,7 @@ import bisq.asset.Asset; import bisq.network.p2p.P2PService; import bisq.common.app.DevEnv; +import bisq.common.util.Tuple3; import org.bitcoinj.core.Coin; import org.bitcoinj.core.InsufficientMoneyException; @@ -61,8 +63,15 @@ import javax.inject.Inject; import javafx.scene.control.Button; import javafx.scene.control.ComboBox; +import javafx.scene.control.Label; +import javafx.scene.control.TextField; import javafx.scene.layout.GridPane; +import javafx.scene.layout.VBox; +import javafx.beans.property.BooleanProperty; +import javafx.beans.property.SimpleBooleanProperty; +import javafx.beans.property.SimpleStringProperty; +import javafx.beans.property.StringProperty; import javafx.beans.value.ChangeListener; import javafx.collections.FXCollections; @@ -77,7 +86,9 @@ import java.util.concurrent.atomic.AtomicBoolean; import javax.annotation.Nullable; import static bisq.desktop.util.FormBuilder.addButtonAfterGroup; +import static bisq.desktop.util.FormBuilder.addComboBox; import static bisq.desktop.util.FormBuilder.addTitledGroupBg; +import static bisq.desktop.util.FormBuilder.addTopLabelReadOnlyTextField; import static com.google.common.base.Preconditions.checkNotNull; @FxmlView @@ -96,6 +107,13 @@ public class MakeProposalView extends ActivatableView implements private Button makeProposalButton; private ComboBox proposalTypeComboBox; private ChangeListener proposalTypeChangeListener; + private TextField nextProposalTextField; + private TitledGroupBg proposalTitledGroup; + private VBox nextProposalBox; + + private BooleanProperty isProposalPhase = new SimpleBooleanProperty(false); + private StringProperty proposalGroupTitle = new SimpleStringProperty(Res.get("dao.proposal.create.phase.inactive")); + @Nullable private ProposalType selectedProposalType; private int gridRow; @@ -129,8 +147,13 @@ public class MakeProposalView extends ActivatableView implements public void initialize() { gridRow = phasesView.addGroup(root, gridRow); - addTitledGroupBg(root, ++gridRow, 1, Res.get("dao.proposal.create.selectProposalType"), Layout.GROUP_DISTANCE); - proposalTypeComboBox = FormBuilder.addComboBox(root, gridRow, + proposalTitledGroup = addTitledGroupBg(root, ++gridRow, 2, proposalGroupTitle.get(), Layout.GROUP_DISTANCE); + final Tuple3 nextProposalPhaseTuple = addTopLabelReadOnlyTextField(root, gridRow, + Res.get("dao.cycle.proposal.next"), + Layout.FIRST_ROW_AND_GROUP_DISTANCE); + nextProposalBox = nextProposalPhaseTuple.third; + nextProposalTextField = nextProposalPhaseTuple.second; + proposalTypeComboBox = addComboBox(root, gridRow, Res.get("dao.proposal.create.proposalType"), Layout.FIRST_ROW_AND_GROUP_DISTANCE); proposalTypeComboBox.setMaxWidth(300); proposalTypeComboBox.setConverter(new StringConverter<>() { @@ -157,6 +180,8 @@ public class MakeProposalView extends ActivatableView implements @Override protected void activate() { + addBindings(); + phasesView.activate(); daoFacade.addBsqStateListener(this); @@ -170,6 +195,8 @@ public class MakeProposalView extends ActivatableView implements @Override protected void deactivate() { + removeBindings(); + phasesView.deactivate(); daoFacade.removeBsqStateListener(this); @@ -179,6 +206,25 @@ public class MakeProposalView extends ActivatableView implements makeProposalButton.setOnAction(null); } + /////////////////////////////////////////////////////////////////////////////////////////// + // Bindings, Listeners + /////////////////////////////////////////////////////////////////////////////////////////// + + private void addBindings() { + proposalTypeComboBox.managedProperty().bind(isProposalPhase); + proposalTypeComboBox.visibleProperty().bind(isProposalPhase); + nextProposalBox.managedProperty().bind(isProposalPhase.not()); + nextProposalBox.visibleProperty().bind(isProposalPhase.not()); + proposalTitledGroup.textProperty().bind(proposalGroupTitle); + } + + private void removeBindings() { + proposalTypeComboBox.managedProperty().unbind(); + proposalTypeComboBox.visibleProperty().unbind(); + nextProposalBox.managedProperty().unbind(); + nextProposalBox.visibleProperty().unbind(); + proposalTitledGroup.textProperty().unbind(); + } /////////////////////////////////////////////////////////////////////////////////////////// // DaoStateListener @@ -186,17 +232,27 @@ public class MakeProposalView extends ActivatableView implements @Override public void onParseTxsCompleteAfterBatchProcessing(Block block) { - boolean isProposalPhase = daoFacade.isInPhaseButNotLastBlock(DaoPhase.Phase.PROPOSAL); - proposalTypeComboBox.setDisable(!isProposalPhase); - if (!isProposalPhase) + isProposalPhase.set(daoFacade.isInPhaseButNotLastBlock(DaoPhase.Phase.PROPOSAL)); + if (isProposalPhase.get()) { + proposalGroupTitle.set(Res.get("dao.proposal.create.selectProposalType")); + } else { + proposalGroupTitle.set(Res.get("dao.proposal.create.phase.inactive")); proposalTypeComboBox.getSelectionModel().clearSelection(); + updateTimeUntilNextProposalPhase(block.getHeight()); + } + } + /////////////////////////////////////////////////////////////////////////////////////////// // Private /////////////////////////////////////////////////////////////////////////////////////////// + private void updateTimeUntilNextProposalPhase(int height) { + nextProposalTextField.setText(DaoUtil.getNextPhaseDuration(height, DaoPhase.Phase.PROPOSAL, daoFacade, btcFormatter)); + } + private void publishMyProposal(ProposalType type) { try { ProposalWithTransaction proposalWithTransaction = getProposalWithTransaction(type); @@ -375,9 +431,8 @@ public class MakeProposalView extends ActivatableView implements } }); proposalDisplay.getComboBoxes().stream() - .filter(Objects::nonNull).forEach(comboBox -> { - inputsValid.set(inputsValid.get() && comboBox.getSelectionModel().getSelectedItem() != null); - }); + .filter(Objects::nonNull).forEach(comboBox -> inputsValid.set(inputsValid.get() && + comboBox.getSelectionModel().getSelectedItem() != null)); InputTextField linkInputTextField = proposalDisplay.linkInputTextField; inputsValid.set(inputsValid.get() && diff --git a/desktop/src/main/java/bisq/desktop/main/offer/MutableOfferViewModel.java b/desktop/src/main/java/bisq/desktop/main/offer/MutableOfferViewModel.java index eac6fdb79e..6ecc75bc9c 100644 --- a/desktop/src/main/java/bisq/desktop/main/offer/MutableOfferViewModel.java +++ b/desktop/src/main/java/bisq/desktop/main/offer/MutableOfferViewModel.java @@ -223,21 +223,8 @@ public abstract class MutableOfferViewModel ext public void activate() { if (DevEnv.isDevMode()) { UserThread.runAfter(() -> { - switch (BisqEnvironment.getBaseCurrencyNetwork().getCurrencyCode()) { - case "BTC": - amount.set("1"); - price.set("0.0002"); - break; - case "LTC": - amount.set("50"); - price.set("40"); - break; - case "DASH": - amount.set("0.1"); - price.set("40"); - break; - } - + amount.set("1"); + price.set("0.0002"); minAmount.set(amount.get()); onFocusOutPriceAsPercentageTextField(true, false); applyMakerFee(); diff --git a/desktop/src/main/java/bisq/desktop/main/portfolio/pendingtrades/steps/TradeStepView.java b/desktop/src/main/java/bisq/desktop/main/portfolio/pendingtrades/steps/TradeStepView.java index ad70129497..14c64a50b6 100644 --- a/desktop/src/main/java/bisq/desktop/main/portfolio/pendingtrades/steps/TradeStepView.java +++ b/desktop/src/main/java/bisq/desktop/main/portfolio/pendingtrades/steps/TradeStepView.java @@ -149,10 +149,6 @@ public abstract class TradeStepView extends AnchorPane { public void onMinuteTick() { updateTimeLeft(); } - - @Override - public void onMissedSecondTick(long missed) { - } }; } diff --git a/desktop/src/main/java/bisq/desktop/main/settings/network/P2pNetworkListItem.java b/desktop/src/main/java/bisq/desktop/main/settings/network/P2pNetworkListItem.java index 79f929065f..0c907865a9 100644 --- a/desktop/src/main/java/bisq/desktop/main/settings/network/P2pNetworkListItem.java +++ b/desktop/src/main/java/bisq/desktop/main/settings/network/P2pNetworkListItem.java @@ -81,10 +81,6 @@ public class P2pNetworkListItem { @Override public void onMinuteTick() { } - - @Override - public void onMissedSecondTick(long missed) { - } }; clock.addListener(listener); onLastActivityChanged(statistic.getLastActivityTimestamp()); diff --git a/gradle/witness/gradle-witness.gradle b/gradle/witness/gradle-witness.gradle index 75c8d891cc..258b9316cc 100644 --- a/gradle/witness/gradle-witness.gradle +++ b/gradle/witness/gradle-witness.gradle @@ -37,7 +37,6 @@ dependencyVerification { 'com.googlecode.json-simple:json-simple:4e69696892b88b41c55d49ab2fdcc21eead92bf54acc588c0050596c3b75199c', 'org.springframework:spring-core:c451e8417adb2ffb2445636da5e44a2f59307c4100037a1fe387c3fba4f29b52', 'ch.qos.logback:logback-classic:e66efc674e94837344bc5b748ff510c37a44eeff86cbfdbf9e714ef2eb374013', - 'network.bisq.libdohj:libdohj-core:b89d2a6ad6a5aff1fccf2d4e5f7cc8c31991746e61913bcec3e999c2b0d7c954', 'com.github.bisq-network.bitcoinj:bitcoinj-core:d148d9577cf96540f7f5367011f7626ff9c9f148f0bf903b541740d480652969', 'org.slf4j:slf4j-api:3a4cd4969015f3beb4b5b4d81dbafc01765fb60b8a439955ca64d8476fef553e', 'ch.qos.logback:logback-core:4cd46fa17d77057b39160058df2f21ebbc2aded51d0edcc25d2c1cecc042a005', diff --git a/p2p/src/main/java/bisq/network/Socks5SeedOnionDiscovery.java b/p2p/src/main/java/bisq/network/Socks5SeedOnionDiscovery.java index 0cbbaaefde..bb23dc7406 100644 --- a/p2p/src/main/java/bisq/network/Socks5SeedOnionDiscovery.java +++ b/p2p/src/main/java/bisq/network/Socks5SeedOnionDiscovery.java @@ -149,22 +149,6 @@ public class Socks5SeedOnionDiscovery implements PeerDiscovery { }; } - /** - * returns .onion nodes available on mainnet - */ - private String[] LitecoinMainNetSeeds() { - return new String[]{ - }; - } - - /** - * returns .onion nodes available on testnet3 - */ - private String[] LitecoinTestNet4Seeds() { - return new String[]{ - }; - } - /** * Returns an array containing all the Bitcoin nodes within the list. */ diff --git a/p2p/src/main/java/bisq/network/p2p/peers/PeerManager.java b/p2p/src/main/java/bisq/network/p2p/peers/PeerManager.java index 3fc06e62cf..7292866449 100644 --- a/p2p/src/main/java/bisq/network/p2p/peers/PeerManager.java +++ b/p2p/src/main/java/bisq/network/p2p/peers/PeerManager.java @@ -151,12 +151,10 @@ public class PeerManager implements ConnectionListener, PersistedDataHost { } @Override - public void onMissedSecondTick(long missed) { - if (missed > Clock.IDLE_TOLERANCE) { - log.info("We have been in standby mode for {} sec", missed / 1000); - stopped = false; - listeners.stream().forEach(Listener::onAwakeFromStandby); - } + public void onAwakeFromStandby(long missedMs) { + // TODO is "stopped = false;" correct? + stopped = false; + listeners.forEach(Listener::onAwakeFromStandby); } }; clock.addListener(listener); diff --git a/pricenode/README.md b/pricenode/README.md index 02c9755734..6e62e2dbed 100644 --- a/pricenode/README.md +++ b/pricenode/README.md @@ -5,7 +5,7 @@ The Bisq pricenode is a simple HTTP service that fetches, transforms and relays data from third-party price providers to Bisq exchange clients on request. Available prices include: - Bitcoin exchange rates, available at `/getAllMarketPrices`, and - - Bitcoin, Litecoin, Dash, and Dogecoin mining fee rates, available at `/getFees` + - Bitcoin mining fee rates, available at `/getFees` Pricenodes are deployed in production as Tor hidden services. This is not because the location of these nodes needs to be kept secret, but rather so that Bisq exchange clients do not need to exit the Tor network in order to get price data. diff --git a/pricenode/src/main/java/bisq/price/mining/providers/DashFeeRateProvider.java b/pricenode/src/main/java/bisq/price/mining/providers/DashFeeRateProvider.java deleted file mode 100644 index abedc627e2..0000000000 --- a/pricenode/src/main/java/bisq/price/mining/providers/DashFeeRateProvider.java +++ /dev/null @@ -1,28 +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.price.mining.providers; - -import org.springframework.stereotype.Component; - -@Component -class DashFeeRateProvider extends FixedFeeRateProvider { - - public DashFeeRateProvider() { - super("DASH", 50); - } -} diff --git a/pricenode/src/main/java/bisq/price/mining/providers/DogecoinFeeRateProvider.java b/pricenode/src/main/java/bisq/price/mining/providers/DogecoinFeeRateProvider.java deleted file mode 100644 index 5edcf3c091..0000000000 --- a/pricenode/src/main/java/bisq/price/mining/providers/DogecoinFeeRateProvider.java +++ /dev/null @@ -1,28 +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.price.mining.providers; - -import org.springframework.stereotype.Component; - -@Component -class DogecoinFeeRateProvider extends FixedFeeRateProvider { - - public DogecoinFeeRateProvider() { - super("DOGE", 5_000_000); - } -} diff --git a/pricenode/src/main/java/bisq/price/mining/providers/FixedFeeRateProvider.java b/pricenode/src/main/java/bisq/price/mining/providers/FixedFeeRateProvider.java deleted file mode 100644 index 2366100179..0000000000 --- a/pricenode/src/main/java/bisq/price/mining/providers/FixedFeeRateProvider.java +++ /dev/null @@ -1,40 +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.price.mining.providers; - -import bisq.price.mining.FeeRate; -import bisq.price.mining.FeeRateProvider; - -import java.time.Duration; -import java.time.Instant; - -abstract class FixedFeeRateProvider extends FeeRateProvider { - - private final String currency; - private final long price; - - public FixedFeeRateProvider(String currency, long price) { - super(Duration.ofDays(1)); - this.currency = currency; - this.price = price; - } - - protected final FeeRate doGet() { - return new FeeRate(currency, price, Instant.now().getEpochSecond()); - } -} diff --git a/pricenode/src/main/java/bisq/price/mining/providers/LitecoinFeeRateProvider.java b/pricenode/src/main/java/bisq/price/mining/providers/LitecoinFeeRateProvider.java deleted file mode 100644 index b6681d9a81..0000000000 --- a/pricenode/src/main/java/bisq/price/mining/providers/LitecoinFeeRateProvider.java +++ /dev/null @@ -1,28 +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.price.mining.providers; - -import org.springframework.stereotype.Component; - -@Component -class LitecoinFeeRateProvider extends FixedFeeRateProvider { - - public LitecoinFeeRateProvider() { - super("LTC", 500); - } -}