From 2450d9b16c2580d80ffd7443ac16cf39adfa35cd Mon Sep 17 00:00:00 2001 From: GM Date: Tue, 3 Sep 2019 12:51:30 +0100 Subject: [PATCH 01/27] List Krypton (ZOD) --- .../main/java/bisq/asset/coins/Krypton.java | 28 +++++++++++ .../META-INF/services/bisq.asset.Asset | 1 + .../java/bisq/asset/coins/KryptonTest.java | 48 +++++++++++++++++++ 3 files changed, 77 insertions(+) create mode 100644 assets/src/main/java/bisq/asset/coins/Krypton.java create mode 100644 assets/src/test/java/bisq/asset/coins/KryptonTest.java diff --git a/assets/src/main/java/bisq/asset/coins/Krypton.java b/assets/src/main/java/bisq/asset/coins/Krypton.java new file mode 100644 index 00000000000..1e8e0770379 --- /dev/null +++ b/assets/src/main/java/bisq/asset/coins/Krypton.java @@ -0,0 +1,28 @@ +/* + * 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.asset.coins; + +import bisq.asset.Coin; +import bisq.asset.RegexAddressValidator; + +public class Krypton extends Coin { + + public Krypton() { + super("Krypton", "ZOD", new RegexAddressValidator("^QQQ[1-9A-Za-z^OIl]{95}")); + } +} diff --git a/assets/src/main/resources/META-INF/services/bisq.asset.Asset b/assets/src/main/resources/META-INF/services/bisq.asset.Asset index 69e7b11d763..6a0dccdbed4 100644 --- a/assets/src/main/resources/META-INF/services/bisq.asset.Asset +++ b/assets/src/main/resources/META-INF/services/bisq.asset.Asset @@ -57,6 +57,7 @@ bisq.asset.coins.Iridium bisq.asset.coins.Kekcoin bisq.asset.coins.KnowYourDeveloper bisq.asset.coins.Kore +bisq.asset.coins.Krypton bisq.asset.coins.Litecoin bisq.asset.coins.LitecoinPlus bisq.asset.coins.LitecoinZ diff --git a/assets/src/test/java/bisq/asset/coins/KryptonTest.java b/assets/src/test/java/bisq/asset/coins/KryptonTest.java new file mode 100644 index 00000000000..1ac55127a79 --- /dev/null +++ b/assets/src/test/java/bisq/asset/coins/KryptonTest.java @@ -0,0 +1,48 @@ +/* + * 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.asset.coins; + +import bisq.asset.AbstractAssetTest; + +import org.junit.Test; + +public class KryptonTest extends AbstractAssetTest { + + public KryptonTest() { + super(new Krypton()); + } + + @Test + public void testValidAddresses() { + assertValidAddress("QQQ1LgQ1m8vX5tGrBZ2miS7A54Fmj5Qbij4UXT8nD4aqF75b1cpAauxVkjYaefcztV62UrDT1K9WHDeQWu4vpVXU2wezpshvex"); + assertValidAddress("QQQ1G56SKneSK1833tKjLH7E4ZgFwnqhqUb1HMHgYbnhaST56mukM1296jiYjTyTdMWnvH5FpWNAJWaQqwyPJHUR8qXRKBJy9o"); + assertValidAddress("QQQ1Bg61uUZhsNaTmUSZNcFgX2bk9wnAoYg9DSYZidDMJt7wVyccvMy8J7zRBoV5iT1pbraFUDWPQWWdXGPPws2P2ZGe8UzsaJ"); + } + + @Test + public void testInvalidAddresses() { + assertInvalidAddress("QQQ1Bg61uUZhsNaTmUSZNcFgX2bk9wnAoYg9DSYZidDMJt7wVyccvMy8J7zRBoV5iT1pbraFUDWPQWWdXGPPws2P2ZGe8"); + assertInvalidAddress("11QQQ1Bg61uUZhsNaTmUSZNcFgX2bk9wnAoYg9DSYZidDMJt7wVyccvMy8J7zRBoV5iT1pbraFUDWPQWWdXGPPws2P2ZGe8UzsaJ"); + assertInvalidAddress(""); + assertInvalidAddress("#RoUKWRwpsx1F"); + assertInvalidAddress("YQQ1G56SKneSK1833tKjLH7E4ZgFwnqhqUb1HMHgYbnhaST56mukM1296jiYjTyTdMWnvH5FpWNAJWaQqwyPJHUR8qXRKBJy9o"); + assertInvalidAddress("3jyRo3rcp9fjdfjdSGpx"); + assertInvalidAddress("QQQ1G56SKneSK1833tKjLH7E4ZgFwnqhqUb1HMHgYbnhaST56mukM1296jiYjTyTdMWnvH5FpWNAJWaQqwyPJHUR8qXRKBJy9#"); + assertInvalidAddress("ZOD1Bg61uUZhsNaTmUSZNcFgX2bk9wnAoYg9DSYZidDMJt7wVyccvMy8J7zRBoV5iT1pbraFUDWPQWWdXGPPws2P2ZGe8UzsaJ"); + } +} \ No newline at end of file From d3335208bb20b174bb166cdc78131c2d440e1f81 Mon Sep 17 00:00:00 2001 From: wiz Date: Sun, 15 Sep 2019 09:59:11 +0900 Subject: [PATCH 02/27] Temporarily disable onion host for @KanoczTomas's BTC node --- core/src/main/java/bisq/core/btc/nodes/BtcNodes.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/src/main/java/bisq/core/btc/nodes/BtcNodes.java b/core/src/main/java/bisq/core/btc/nodes/BtcNodes.java index 79057fa129b..0702a7e4d22 100644 --- a/core/src/main/java/bisq/core/btc/nodes/BtcNodes.java +++ b/core/src/main/java/bisq/core/btc/nodes/BtcNodes.java @@ -69,7 +69,7 @@ public List getProvidedBtcNodes() { new BtcNode("btc2.sqrrm.net", "i3a5xtzfm4xwtybd.onion", "81.171.22.143", BtcNode.DEFAULT_PORT, "@sqrrm"), // KanoczTomas - new BtcNode("btc.ispol.sk", "mbm6ffx6j5ygi2ck.onion", "193.58.196.212", BtcNode.DEFAULT_PORT, "@KanoczTomas"), + new BtcNode("btc.ispol.sk", null, "193.58.196.212", BtcNode.DEFAULT_PORT, "@KanoczTomas"), // Devin Bileck new BtcNode("btc1.dnsalias.net", "lva54pnbq2nsmjyr.onion", "165.227.34.198", BtcNode.DEFAULT_PORT, "@devinbileck"), From 047ec4abaa54d4974ab4ad1da8f185084591a103 Mon Sep 17 00:00:00 2001 From: Jason Davies Date: Wed, 18 Sep 2019 12:36:02 +0100 Subject: [PATCH 03/27] Add Ergo (ERG) without Bouncy Castle dependency. See #3195. --- .../src/main/java/bisq/asset/coins/Ergo.java | 53 +++++++++++++++++++ .../META-INF/services/bisq.asset.Asset | 1 + .../test/java/bisq/asset/coins/ErgoTest.java | 47 ++++++++++++++++ 3 files changed, 101 insertions(+) create mode 100644 assets/src/main/java/bisq/asset/coins/Ergo.java create mode 100644 assets/src/test/java/bisq/asset/coins/ErgoTest.java diff --git a/assets/src/main/java/bisq/asset/coins/Ergo.java b/assets/src/main/java/bisq/asset/coins/Ergo.java new file mode 100644 index 00000000000..fd9ae801cda --- /dev/null +++ b/assets/src/main/java/bisq/asset/coins/Ergo.java @@ -0,0 +1,53 @@ +/* + * 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.asset.coins; + +import bisq.asset.AddressValidationResult; +import bisq.asset.AddressValidator; +import bisq.asset.Coin; + +import java.util.Arrays; + +import org.bitcoinj.core.Base58; +import org.bitcoinj.core.AddressFormatException; + +public class Ergo extends Coin { + + public Ergo() { + super("Ergo", "ERG", new ErgoAddressValidator()); + } + + public static class ErgoAddressValidator implements AddressValidator { + + @Override + public AddressValidationResult validate(String address) { + try { + byte[] decoded = Base58.decode(address); + if (decoded.length < 4) { + return AddressValidationResult.invalidAddress("Input too short: " + decoded.length); + } + if (decoded[0] != 1 && decoded[0] != 2 && decoded[0] != 3) { + return AddressValidationResult.invalidAddress("Invalid prefix"); + } + } catch (AddressFormatException e) { + return AddressValidationResult.invalidAddress(e); + } + return AddressValidationResult.validAddress(); + } + } +} diff --git a/assets/src/main/resources/META-INF/services/bisq.asset.Asset b/assets/src/main/resources/META-INF/services/bisq.asset.Asset index 33c63a2a430..69e7b11d763 100644 --- a/assets/src/main/resources/META-INF/services/bisq.asset.Asset +++ b/assets/src/main/resources/META-INF/services/bisq.asset.Asset @@ -40,6 +40,7 @@ bisq.asset.coins.Donu bisq.asset.coins.Dragonglass bisq.asset.coins.DSTRA bisq.asset.coins.Emercoin +bisq.asset.coins.Ergo bisq.asset.coins.Ether bisq.asset.coins.EtherClassic bisq.asset.coins.FourtyTwo diff --git a/assets/src/test/java/bisq/asset/coins/ErgoTest.java b/assets/src/test/java/bisq/asset/coins/ErgoTest.java new file mode 100644 index 00000000000..213769cd81a --- /dev/null +++ b/assets/src/test/java/bisq/asset/coins/ErgoTest.java @@ -0,0 +1,47 @@ +/* + * 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.asset.coins; + +import bisq.asset.AbstractAssetTest; + +import org.junit.Test; + +public class ErgoTest extends AbstractAssetTest { + + public ErgoTest() { + super(new Ergo()); + } + + @Test + public void testValidAddresses() { + assertValidAddress("9fRAWhdxEsTcdb8PhGNrZfwqa65zfkuYHAMmkQLcic1gdLSV5vA"); + assertValidAddress("25qGdVWg2yyYho8uC1pLtc7KxFn4nEEAwD"); + assertValidAddress("23NL9a8ngN28ovtLiKLgHexcdTKBbUMLhH"); + assertValidAddress("7bwdkU5V8"); + assertValidAddress("BxKBaHkvrTvLZrDcZjcsxsF7aSsrN73ijeFZXtbj4CXZHHcvBtqSxQ"); + } + + @Test + public void testInvalidAddresses() { + assertInvalidAddress("9fRAWhdxEsTcdb8PhGNrZfwqa65zfkuYHAMmkQLcic1gdLSV5vAaa"); + assertInvalidAddress("25qGdVWg2yyYho8uC1pLtc7KxFn4nEEAwDaa"); + assertInvalidAddress("23NL9a8ngN28ovtLiKLgHexcdTKBbUMLhHaa"); + assertInvalidAddress("7bwdkU5V8aa"); + assertInvalidAddress("BxKBaHkvrTvLZrDcZjcsxsF7aSsrN73ijeFZXtbj4CXZHHcvBtqSxQ#"); + } +} From fbd6525ebe8aca87316df85a562f4eb83dd08b84 Mon Sep 17 00:00:00 2001 From: cryptogeuse Date: Tue, 24 Sep 2019 16:11:40 -0400 Subject: [PATCH 04/27] List CTSCoin (CTSC) --- .../main/java/bisq/asset/coins/CTSCoin.java | 36 ++++++++++++++++ .../META-INF/services/bisq.asset.Asset | 1 + .../java/bisq/asset/coins/CTSCoinTest.java | 43 +++++++++++++++++++ 3 files changed, 80 insertions(+) create mode 100644 assets/src/main/java/bisq/asset/coins/CTSCoin.java create mode 100644 assets/src/test/java/bisq/asset/coins/CTSCoinTest.java diff --git a/assets/src/main/java/bisq/asset/coins/CTSCoin.java b/assets/src/main/java/bisq/asset/coins/CTSCoin.java new file mode 100644 index 00000000000..7db46edc262 --- /dev/null +++ b/assets/src/main/java/bisq/asset/coins/CTSCoin.java @@ -0,0 +1,36 @@ +/* + * 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.asset.coins; + +import bisq.asset.Base58BitcoinAddressValidator; +import bisq.asset.Coin; +import bisq.asset.NetworkParametersAdapter; + +public class CTSCoin extends Coin { + public CTSCoin() { + super("CTSCoin", "CTSC", new Base58BitcoinAddressValidator(new CtscMainNetParams())); + } + + public static class CtscMainNetParams extends NetworkParametersAdapter { + public CtscMainNetParams() { + this.addressHeader = 66; + this.p2shHeader = 16; + this.acceptableAddressCodes = new int[]{this.addressHeader, this.p2shHeader}; + } + } +} diff --git a/assets/src/main/resources/META-INF/services/bisq.asset.Asset b/assets/src/main/resources/META-INF/services/bisq.asset.Asset index ed22d1cac15..7cf87a42b73 100644 --- a/assets/src/main/resources/META-INF/services/bisq.asset.Asset +++ b/assets/src/main/resources/META-INF/services/bisq.asset.Asset @@ -29,6 +29,7 @@ bisq.asset.coins.Counterparty bisq.asset.coins.Credits bisq.asset.coins.Croat bisq.asset.coins.CRowdCLassic +bisq.asset.coins.CTSCoin bisq.asset.coins.DarkPay bisq.asset.coins.Dash bisq.asset.coins.Decred diff --git a/assets/src/test/java/bisq/asset/coins/CTSCoinTest.java b/assets/src/test/java/bisq/asset/coins/CTSCoinTest.java new file mode 100644 index 00000000000..adbe76f7da7 --- /dev/null +++ b/assets/src/test/java/bisq/asset/coins/CTSCoinTest.java @@ -0,0 +1,43 @@ +/* + * 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.asset.coins; + +import bisq.asset.AbstractAssetTest; + +import org.junit.Test; + +public class CTSCoinTest extends AbstractAssetTest { + + public CTSCoinTest() { + super(new CTSCoin()); + } + + @Test + public void testValidAddresses() { + assertValidAddress("Ti6S7JhtxKjSytZDmyMV4pVNVAPeiVsnpT"); + assertValidAddress("TwzRDeNSPcJvquuGu7WxxH3RhXBR1VPYHZ"); + assertValidAddress("TgYGQJd5TEzDRkyXt1tCvUnrbWBu38C8YK"); + } + + @Test + public void testInvalidAddresses() { + assertInvalidAddress("ti6S7JhtxKjSytZDmyMV4pVNVAPeiVsnpT"); + assertInvalidAddress("2i6S7JhtxKjSytZDmyMV4pVNVAPeiVsnpT"); + assertInvalidAddress("Ti6S7JhtxKjSytZDmyMV4pVNVAPeiVsnp#"); + } +} From c63c77ce1ee5f8daa368ab859e9772ed106bc45a Mon Sep 17 00:00:00 2001 From: wiz Date: Sat, 28 Sep 2019 18:00:28 +0900 Subject: [PATCH 05/27] Tweak the English name of Japan Bank Transfer payment method --- core/src/main/resources/i18n/displayStrings.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/src/main/resources/i18n/displayStrings.properties b/core/src/main/resources/i18n/displayStrings.properties index 4fe68119f48..a14a7b6603a 100644 --- a/core/src/main/resources/i18n/displayStrings.properties +++ b/core/src/main/resources/i18n/displayStrings.properties @@ -2877,7 +2877,7 @@ CASH_DEPOSIT=Cash Deposit MONEY_GRAM=MoneyGram WESTERN_UNION=Western Union F2F=Face to face (in person) -JAPAN_BANK=Japan Zengin Furikomi +JAPAN_BANK=Japan Bank Furikomi # suppress inspection "UnusedProperty" NATIONAL_BANK_SHORT=National banks From f71cf15e2ed25d347e4b8818e0204d56001d1559 Mon Sep 17 00:00:00 2001 From: Kariyama Saiko Date: Sat, 28 Sep 2019 14:18:59 +0300 Subject: [PATCH 06/27] List Animecoin (ANI) --- .../main/java/bisq/asset/coins/Animecoin.java | 36 +++++++++++++++ .../META-INF/services/bisq.asset.Asset | 1 + .../java/bisq/asset/coins/AnimecoinTest.java | 44 +++++++++++++++++++ 3 files changed, 81 insertions(+) create mode 100644 assets/src/main/java/bisq/asset/coins/Animecoin.java create mode 100644 assets/src/test/java/bisq/asset/coins/AnimecoinTest.java diff --git a/assets/src/main/java/bisq/asset/coins/Animecoin.java b/assets/src/main/java/bisq/asset/coins/Animecoin.java new file mode 100644 index 00000000000..7ddbe6db364 --- /dev/null +++ b/assets/src/main/java/bisq/asset/coins/Animecoin.java @@ -0,0 +1,36 @@ +/* + * 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.asset.coins; + +import bisq.asset.Base58BitcoinAddressValidator; +import bisq.asset.Coin; +import bisq.asset.NetworkParametersAdapter; + +public class Animecoin extends Coin { + public Animecoin() { + super("Animecoin", "ANI", new Base58BitcoinAddressValidator(new AnimecoinMainNetParams())); + } + + public static class AnimecoinMainNetParams extends NetworkParametersAdapter { + public AnimecoinMainNetParams() { + this.addressHeader = 23; + this.p2shHeader = 9; + this.acceptableAddressCodes = new int[]{this.addressHeader, this.p2shHeader}; + } + } +} diff --git a/assets/src/main/resources/META-INF/services/bisq.asset.Asset b/assets/src/main/resources/META-INF/services/bisq.asset.Asset index f1c7e0b0dae..61ce31e710e 100644 --- a/assets/src/main/resources/META-INF/services/bisq.asset.Asset +++ b/assets/src/main/resources/META-INF/services/bisq.asset.Asset @@ -6,6 +6,7 @@ bisq.asset.coins.Actinium bisq.asset.coins.Adeptio bisq.asset.coins.Aeon bisq.asset.coins.Amitycoin +bisq.asset.coins.Animecoin bisq.asset.coins.Arqma bisq.asset.coins.Askcoin bisq.asset.coins.Australiacash diff --git a/assets/src/test/java/bisq/asset/coins/AnimecoinTest.java b/assets/src/test/java/bisq/asset/coins/AnimecoinTest.java new file mode 100644 index 00000000000..7538294578c --- /dev/null +++ b/assets/src/test/java/bisq/asset/coins/AnimecoinTest.java @@ -0,0 +1,44 @@ +/* + * 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.asset.coins; + +import bisq.asset.AbstractAssetTest; + +import org.junit.Test; + +public class AnimecoinTest extends AbstractAssetTest { + + public AnimecoinTest() { + super(new Animecoin()); + } + + @Test + public void testValidAddresses() { + assertValidAddress("Aa6TDuudiNh7DRzs11wEzZWiw9QBZY3Qw1"); + assertValidAddress("AdsdUhnPsJwg5NvAuyxs4EsaE2GoSHohoq"); + assertValidAddress("4s2peLxJJ2atz1tnAKpFshnVPKTmR312fr"); + + } + + @Test + public void testInvalidAddresses() { + assertInvalidAddress("aa6TDuudiNh7DRzs11wEzZWiw9QBZY3Qw1"); + assertInvalidAddress("3s2peLxJJ2atz1tnAKpFshnVPKTmR312fr"); + assertInvalidAddress("ANNPzjj2ZYEhpyJ6p6sWeH1JXbkCSmNSd#"); + } +} From b1c8141d4815e32455e38b357bb91ec712fb491e Mon Sep 17 00:00:00 2001 From: chimp1984 Date: Wed, 2 Oct 2019 00:18:32 -0500 Subject: [PATCH 07/27] Add mediator prefix to trade statistics --- .../trade/protocol/tasks/PublishTradeStatistics.java | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/core/src/main/java/bisq/core/trade/protocol/tasks/PublishTradeStatistics.java b/core/src/main/java/bisq/core/trade/protocol/tasks/PublishTradeStatistics.java index 9a51cbb8bf4..e6c7342d6dd 100644 --- a/core/src/main/java/bisq/core/trade/protocol/tasks/PublishTradeStatistics.java +++ b/core/src/main/java/bisq/core/trade/protocol/tasks/PublishTradeStatistics.java @@ -64,6 +64,18 @@ protected void run() { extraDataMap.put(TradeStatistics2.ARBITRATOR_ADDRESS, address); } + NodeAddress mediatorNodeAddress = trade.getMediatorNodeAddress(); + if (mediatorNodeAddress != null) { + // The first 4 chars are sufficient to identify an arbitrator. + // For testing with regtest/localhost we use the full address as its localhost and would result in + // same values for multiple arbitrators. + NetworkNode networkNode = model.getProcessModel().getP2PService().getNetworkNode(); + String address = networkNode instanceof TorNetworkNode ? + mediatorNodeAddress.getFullAddress().substring(0, 4) : + mediatorNodeAddress.getFullAddress(); + extraDataMap.put(TradeStatistics2.MEDIATOR_ADDRESS, address); + } + Offer offer = trade.getOffer(); checkNotNull(offer, "offer must not ne null"); checkNotNull(trade.getTradeAmount(), "trade.getTradeAmount() must not ne null"); From 406c0989a1abd19127316ce3d548984a49c4bbe2 Mon Sep 17 00:00:00 2001 From: John Salatas Date: Wed, 2 Oct 2019 19:02:54 -0700 Subject: [PATCH 08/27] List Faircoin (FAIR) --- .../main/java/bisq/asset/coins/Faircoin.java | 39 ++++++++++++++++++ .../META-INF/services/bisq.asset.Asset | 1 + .../java/bisq/asset/coins/FaircoinTest.java | 41 +++++++++++++++++++ 3 files changed, 81 insertions(+) create mode 100644 assets/src/main/java/bisq/asset/coins/Faircoin.java create mode 100644 assets/src/test/java/bisq/asset/coins/FaircoinTest.java diff --git a/assets/src/main/java/bisq/asset/coins/Faircoin.java b/assets/src/main/java/bisq/asset/coins/Faircoin.java new file mode 100644 index 00000000000..d94efa3a9a4 --- /dev/null +++ b/assets/src/main/java/bisq/asset/coins/Faircoin.java @@ -0,0 +1,39 @@ +/* + * 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.asset.coins; + +import bisq.asset.Base58BitcoinAddressValidator; +import bisq.asset.Coin; +import bisq.asset.NetworkParametersAdapter; + +public class Faircoin extends Coin { + + public Faircoin() { + super("Faircoin", "FAIR", new Base58BitcoinAddressValidator(new Faircoin.FaircoinParams())); + } + + public static class FaircoinParams extends NetworkParametersAdapter { + + public FaircoinParams() { + addressHeader = 95; + p2shHeader = 36; + acceptableAddressCodes = new int[]{addressHeader, p2shHeader}; + } + } + +} diff --git a/assets/src/main/resources/META-INF/services/bisq.asset.Asset b/assets/src/main/resources/META-INF/services/bisq.asset.Asset index f1c7e0b0dae..1e398d994c0 100644 --- a/assets/src/main/resources/META-INF/services/bisq.asset.Asset +++ b/assets/src/main/resources/META-INF/services/bisq.asset.Asset @@ -43,6 +43,7 @@ bisq.asset.coins.Emercoin bisq.asset.coins.Ergo bisq.asset.coins.Ether bisq.asset.coins.EtherClassic +bisq.asset.coins.Faircoin bisq.asset.coins.FourtyTwo bisq.asset.coins.Fujicoin bisq.asset.coins.Galilel diff --git a/assets/src/test/java/bisq/asset/coins/FaircoinTest.java b/assets/src/test/java/bisq/asset/coins/FaircoinTest.java new file mode 100644 index 00000000000..4f4b85186f8 --- /dev/null +++ b/assets/src/test/java/bisq/asset/coins/FaircoinTest.java @@ -0,0 +1,41 @@ +/* + * 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.asset.coins; + +import bisq.asset.AbstractAssetTest; + +public class FaircoinTest extends AbstractAssetTest { + + public FaircoinTest() { + super(new Faircoin()); + } + + @Override + public void testValidAddresses() { + assertValidAddress("fLsJC1Njap5NxSArYr5wCJbKBbTQfWikY6"); + assertValidAddress("FZHzHraqjty2Co7TinwcsBtPKoz5ANvgRd"); + assertValidAddress("fHbXBBBjU1xxEVmWEtAEwXnoBDxxsxfvxg"); + } + + @Override + public void testInvalidAddresses() { + assertInvalidAddress("FLsJC1Njap5NxSArYr5wCJbKBbTQfWikY6"); + assertInvalidAddress("fZHzHraqjty2Co7TinwcsBtPKoz5ANvgRd"); + assertInvalidAddress("1HbXBBBjU1xxEVmWEtAEwXnoBDxxsxfvxg"); + } +} From f5f461111ecae5a17a331ef3fe306dbb01ac5df5 Mon Sep 17 00:00:00 2001 From: Kyle Pierce Date: Tue, 1 Oct 2019 08:10:15 -0400 Subject: [PATCH 09/27] List uPlexa (UPX) --- .../main/java/bisq/asset/coins/uPlexa.java | 30 ++++++++++++ .../META-INF/services/bisq.asset.Asset | 1 + .../java/bisq/asset/coins/uPlexaTest.java | 48 +++++++++++++++++++ .../resources/i18n/displayStrings.properties | 18 +++++++ 4 files changed, 97 insertions(+) create mode 100644 assets/src/main/java/bisq/asset/coins/uPlexa.java create mode 100644 assets/src/test/java/bisq/asset/coins/uPlexaTest.java diff --git a/assets/src/main/java/bisq/asset/coins/uPlexa.java b/assets/src/main/java/bisq/asset/coins/uPlexa.java new file mode 100644 index 00000000000..fbaaf7d5344 --- /dev/null +++ b/assets/src/main/java/bisq/asset/coins/uPlexa.java @@ -0,0 +1,30 @@ +/* + * 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.asset.coins; + +import bisq.asset.AltCoinAccountDisclaimer; +import bisq.asset.Coin; +import bisq.asset.RegexAddressValidator; + +@AltCoinAccountDisclaimer("account.altcoin.popup.upx.msg") +public class uPlexa extends Coin { + + public uPlexa() { + super("uPlexa", "UPX", new RegexAddressValidator("^((UPX)[1-9A-Za-z^OIl]{95}|(UPi)[1-9A-Za-z^OIl]{106}|(UmV|UmW)[1-9A-Za-z^OIl]{94})$")); + } +} diff --git a/assets/src/main/resources/META-INF/services/bisq.asset.Asset b/assets/src/main/resources/META-INF/services/bisq.asset.Asset index f1c7e0b0dae..7d442e2d566 100644 --- a/assets/src/main/resources/META-INF/services/bisq.asset.Asset +++ b/assets/src/main/resources/META-INF/services/bisq.asset.Asset @@ -100,6 +100,7 @@ bisq.asset.coins.TEO bisq.asset.coins.TurtleCoin bisq.asset.coins.UnitedCommunityCoin bisq.asset.coins.Unobtanium +bisq.asset.coins.uPlexa bisq.asset.coins.VARIUS bisq.asset.coins.Veil bisq.asset.coins.Vertcoin diff --git a/assets/src/test/java/bisq/asset/coins/uPlexaTest.java b/assets/src/test/java/bisq/asset/coins/uPlexaTest.java new file mode 100644 index 00000000000..a4950f7ff3c --- /dev/null +++ b/assets/src/test/java/bisq/asset/coins/uPlexaTest.java @@ -0,0 +1,48 @@ +/* + * 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.asset.coins; + +import bisq.asset.AbstractAssetTest; +import org.junit.Test; + +public class uPlexaTest extends AbstractAssetTest { + + public uPlexaTest() { + super(new uPlexa()); + } + + @Test + public void testValidAddresses() { + assertValidAddress("UPX1dz81hmfWc7AUhn16JATXJJgZeQZ4zLKA4tnHJHcdS5zoSaKQUoaGqDUQnTXecPL4mjJF1vkwRF3EEq5UJdSw8A84sXDjFP"); + assertValidAddress("UPi1S1uqRRNSgC26PjasZP8FwTBRwnAEmBnx5mAYsbGqRvsU46aficYEA3FAT621EuPeChyKQumS7j6jpF74zW9tLJMve8kUJLP5zUgR5ts8W"); + assertValidAddress("UmV7QTQs5Q47wMPggtuQSMTvuqNie1MRmbD4AG1xJXykZmxBG4P18p4CHqkV5sKDRXauXWbs76835PZoemQmPGJC1Dv2zdF43"); + assertValidAddress("UmWh1MthnAiRP4GuN3DEQxPt6kgeAZfJLUuX1krtufAj2XvUJxDYnuYTAQzEp25V2W8BAJQkfXj8yFNUqQphxddN35nRLnZeE"); + } + + @Test + public void testInvalidAddresses() { + assertInvalidAddress(""); + assertInvalidAddress("UPXLsinT9duNEtHGqAUicJKD2cmGiB9gB6sqHqWvV6suB4TtPSR8ynyh2vVVvNyDE6g7WEaBxCG8GD1KM2ffWPx7FLXgeJbNYrp"); + assertInvalidAddress("UPXsjCoYrxag2pPoDDTB4cRriKCNn8WjhY99kqjYuNdTfE4MU2Yo1CPdpyK7PXpxDcAd5YDNerE6WCc4cVQvEbxLaHk4UcvbRp2"); + assertInvalidAddress("UPXsinT9duNEtHGqAUicJKD2cmGiB9gB6sqHqWvV6suBx4TtPSR8ynyh2vVVvNyDE6g7W!!!xCG8GD1KM2ffWP7FLXgeJbNYrp2"); + assertInvalidAddress("UmVSrJ7ES1IIIIIGHFm69SU6dTTKt8Vi6V7BoC3wsLccd1Y2CXgQkW7vHSe5uArGU9TjUC5RtvzhCycVDnPPbThTmZA8VqDzTP"); + assertInvalidAddress("UmWrJ7ES1wGsikGHFm69SU6dTTKt8Vi6V7BoC3wsLcc1xY2CXgQkW7vHSe5uArGU9TjUC5RtvzhCycVDnPPbThTmZA8VqDzTPe"); + assertInvalidAddress("UPi12rJ7ES1wGsikGHFm69SU6dTTKt8Vi6V7BoC36sqHqWvwsLcc1Y2CXgQkW7vHSe5uArGU9TjUC5RtvzhCycVDnPPbThTmZA8VqDzTPeM1"); + assertInvalidAddress("UPisBB18NdcSywKDshsywbjc5uCi8ybSUtWgvM3LfzaYe93vd6DEu3PcSywKDshsywbjc5uCi8ybSUtWgvM3LfzaYe93d96NjjvBCYU2SZD2of"); + } +} diff --git a/core/src/main/resources/i18n/displayStrings.properties b/core/src/main/resources/i18n/displayStrings.properties index a14a7b6603a..aae6f7ad16a 100644 --- a/core/src/main/resources/i18n/displayStrings.properties +++ b/core/src/main/resources/i18n/displayStrings.properties @@ -1142,6 +1142,24 @@ described on the {1} web page.\nUsing wallets from centralized exchanges where ( (b) which don''t use compatible wallet software is risky: it can lead to loss of the traded funds!\nThe mediator or arbitrator is \ not a {2} specialist and cannot help in such cases. account.altcoin.popup.wallet.confirm=I understand and confirm that I know which wallet I need to use. +account.altcoin.popup.upx.msg=Trading UPX on Bisq requires that you understand and fulfill \ +the following requirements:\n\n\ +For sending UPX, you need to use either the official uPlexa GUI wallet or uPlexa CLI wallet with the \ +store-tx-info flag enabled (default in new versions). Please be sure you can access the tx key as \ +that would be required in case of a dispute.\n\ +uplexa-wallet-cli (use the command get_tx_key)\n\ +uplexa-wallet-gui (go to history tab and click on the (P) button for payment proof)\n\n\ +At normal block explorers the transfer is not verifiable.\n\n\ +You need to provide the arbitrator the following data in case of a dispute:\n\ +- The tx private key\n\ +- The transaction hash\n\ +- The recipient's public address\n\n\ +Failure to provide the above data, or if you used an incompatible wallet, will result in losing the \ +dispute case. The UPX sender is responsible for providing verification of the UPX transfer to the \ +arbitrator in case of a dispute.\n\n\ +There is no payment ID required, just the normal public address.\n\ +If you are not sure about that process visit uPlexa discord channel (https://discord.gg/vhdNSrV) \ +or the uPlexa Telegram Chat (https://t.me/uplexaOfficial) to find more information. account.altcoin.popup.arq.msg=Trading ARQ on Bisq requires that you understand and fulfill \ the following requirements:\n\n\ For sending ARQ, you need to use either the official ArQmA GUI wallet or ArQmA CLI wallet with the \ From d20afd6ec5db8fa308edaace12705df4f3f8f425 Mon Sep 17 00:00:00 2001 From: lukasz Date: Thu, 3 Oct 2019 20:14:43 +0200 Subject: [PATCH 10/27] Remove not used private methods from BisqEnvironment --- core/src/main/java/bisq/core/app/BisqEnvironment.java | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/core/src/main/java/bisq/core/app/BisqEnvironment.java b/core/src/main/java/bisq/core/app/BisqEnvironment.java index fdc211ad583..2c542bc64c3 100644 --- a/core/src/main/java/bisq/core/app/BisqEnvironment.java +++ b/core/src/main/java/bisq/core/app/BisqEnvironment.java @@ -94,8 +94,6 @@ public static void setDefaultAppName(String defaultAppName) { public static final String BISQ_COMMANDLINE_PROPERTY_SOURCE_NAME = "bisqCommandLineProperties"; public static final String BISQ_APP_DIR_PROPERTY_SOURCE_NAME = "bisqAppDirProperties"; public static final String BISQ_DEFAULT_PROPERTY_SOURCE_NAME = "bisqDefaultProperties"; - private static final String BISQ_HOME_DIR_PROPERTY_SOURCE_NAME = "bisqHomeDirProperties"; - private static final String BISQ_CLASSPATH_PROPERTY_SOURCE_NAME = "bisqClasspathProperties"; private static String staticAppDataDir; @@ -460,14 +458,6 @@ PropertySource getAppDirProperties() throws Exception { return new ResourcePropertySource(BISQ_APP_DIR_PROPERTY_SOURCE_NAME, resource); } - private PropertySource homeDirProperties() { - return new PropertySource.StubPropertySource(BISQ_HOME_DIR_PROPERTY_SOURCE_NAME); - } - - private PropertySource classpathProperties() { - return new PropertySource.StubPropertySource(BISQ_CLASSPATH_PROPERTY_SOURCE_NAME); - } - private PropertySource defaultProperties() { return new PropertiesPropertySource(BISQ_DEFAULT_PROPERTY_SOURCE_NAME, new Properties() { { From b6cc3518a95ef8a3787b9c657278c74b906f4325 Mon Sep 17 00:00:00 2001 From: Manfred Karrer Date: Wed, 16 Jan 2019 11:41:33 +0100 Subject: [PATCH 11/27] Add onInitP2pNetwork and onInitWallet to BisqSetupListener - Rename BisqSetupCompleteListener to BisqSetupListener - Add onInitP2pNetwork and onInitWallet to BisqSetupListener - make onInitP2pNetwork and onInitWallet default so no impl. required --- .../java/bisq/core/app/BisqExecutable.java | 4 ++-- .../java/bisq/core/app/BisqHeadlessApp.java | 2 +- .../main/java/bisq/core/app/BisqSetup.java | 20 ++++++++++++++----- .../main/java/bisq/core/app/HeadlessApp.java | 2 +- .../java/bisq/desktop/main/MainViewModel.java | 6 +++--- 5 files changed, 22 insertions(+), 12 deletions(-) diff --git a/core/src/main/java/bisq/core/app/BisqExecutable.java b/core/src/main/java/bisq/core/app/BisqExecutable.java index f5935a54067..337dc8a885d 100644 --- a/core/src/main/java/bisq/core/app/BisqExecutable.java +++ b/core/src/main/java/bisq/core/app/BisqExecutable.java @@ -72,7 +72,7 @@ import static java.lang.String.format; @Slf4j -public abstract class BisqExecutable implements GracefulShutDownHandler, BisqSetup.BisqSetupCompleteListener { +public abstract class BisqExecutable implements GracefulShutDownHandler, BisqSetup.BisqSetupListener { private final String fullName; private final String scriptName; @@ -261,7 +261,7 @@ protected void onApplicationStarted() { protected void startAppSetup() { BisqSetup bisqSetup = injector.getInstance(BisqSetup.class); - bisqSetup.addBisqSetupCompleteListener(this); + bisqSetup.addBisqSetupListener(this); bisqSetup.start(); } diff --git a/core/src/main/java/bisq/core/app/BisqHeadlessApp.java b/core/src/main/java/bisq/core/app/BisqHeadlessApp.java index f7ece906fb7..22c23deccf3 100644 --- a/core/src/main/java/bisq/core/app/BisqHeadlessApp.java +++ b/core/src/main/java/bisq/core/app/BisqHeadlessApp.java @@ -54,7 +54,7 @@ public BisqHeadlessApp() { public void startApplication() { try { bisqSetup = injector.getInstance(BisqSetup.class); - bisqSetup.addBisqSetupCompleteListener(this); + bisqSetup.addBisqSetupListener(this); corruptedDatabaseFilesHandler = injector.getInstance(CorruptedDatabaseFilesHandler.class); tradeManager = injector.getInstance(TradeManager.class); diff --git a/core/src/main/java/bisq/core/app/BisqSetup.java b/core/src/main/java/bisq/core/app/BisqSetup.java index 18763753fcf..eb62d15cef4 100644 --- a/core/src/main/java/bisq/core/app/BisqSetup.java +++ b/core/src/main/java/bisq/core/app/BisqSetup.java @@ -116,7 +116,15 @@ @Slf4j @Singleton public class BisqSetup { - public interface BisqSetupCompleteListener { + public interface BisqSetupListener { + default void onInitP2pNetwork() { + log.info("onInitP2pNetwork"); + } + + default void onInitWallet() { + log.info("onInitWallet"); + } + void onSetupComplete(); } @@ -201,7 +209,7 @@ public interface BisqSetupCompleteListener { private boolean allBasicServicesInitialized; @SuppressWarnings("FieldCanBeLocal") private MonadicBinding p2pNetworkAndWalletInitialized; - private List bisqSetupCompleteListeners = new ArrayList<>(); + private List bisqSetupListeners = new ArrayList<>(); @Inject public BisqSetup(P2PNetworkSetup p2PNetworkSetup, @@ -296,8 +304,8 @@ public BisqSetup(P2PNetworkSetup p2PNetworkSetup, // Setup /////////////////////////////////////////////////////////////////////////////////////////// - public void addBisqSetupCompleteListener(BisqSetupCompleteListener listener) { - bisqSetupCompleteListeners.add(listener); + public void addBisqSetupListener(BisqSetupListener listener) { + bisqSetupListeners.add(listener); } public void start() { @@ -328,7 +336,7 @@ private void step4() { private void step5() { initDomainServices(); - bisqSetupCompleteListeners.forEach(BisqSetupCompleteListener::onSetupComplete); + bisqSetupListeners.forEach(BisqSetupListener::onSetupComplete); // We set that after calling the setupCompleteHandler to not trigger a popup from the dev dummy accounts // in MainViewModel @@ -524,6 +532,7 @@ else if (displayTorNetworkSettingsHandler != null) }, STARTUP_TIMEOUT_MINUTES, TimeUnit.MINUTES); + bisqSetupListeners.forEach(BisqSetupListener::onInitP2pNetwork); p2pNetworkReady = p2PNetworkSetup.init(this::initWallet, displayTorNetworkSettingsHandler); // We only init wallet service here if not using Tor for bitcoinj. @@ -550,6 +559,7 @@ else if (displayTorNetworkSettingsHandler != null) } private void initWallet() { + bisqSetupListeners.forEach(BisqSetupListener::onInitWallet); Runnable walletPasswordHandler = () -> { if (p2pNetworkReady.get()) p2PNetworkSetup.setSplashP2PNetworkAnimationVisible(true); diff --git a/core/src/main/java/bisq/core/app/HeadlessApp.java b/core/src/main/java/bisq/core/app/HeadlessApp.java index 8d105a93398..3808b89b1a0 100644 --- a/core/src/main/java/bisq/core/app/HeadlessApp.java +++ b/core/src/main/java/bisq/core/app/HeadlessApp.java @@ -22,7 +22,7 @@ import com.google.inject.Injector; -public interface HeadlessApp extends UncaughtExceptionHandler, BisqSetup.BisqSetupCompleteListener { +public interface HeadlessApp extends UncaughtExceptionHandler, BisqSetup.BisqSetupListener { void setGracefulShutDownHandler(GracefulShutDownHandler gracefulShutDownHandler); void setInjector(Injector injector); diff --git a/desktop/src/main/java/bisq/desktop/main/MainViewModel.java b/desktop/src/main/java/bisq/desktop/main/MainViewModel.java index b58042e59b6..70726c52ac7 100644 --- a/desktop/src/main/java/bisq/desktop/main/MainViewModel.java +++ b/desktop/src/main/java/bisq/desktop/main/MainViewModel.java @@ -95,7 +95,7 @@ import lombok.extern.slf4j.Slf4j; @Slf4j -public class MainViewModel implements ViewModel, BisqSetup.BisqSetupCompleteListener { +public class MainViewModel implements ViewModel, BisqSetup.BisqSetupListener { private final BisqSetup bisqSetup; private final WalletsSetup walletsSetup; private final User user; @@ -191,12 +191,12 @@ public MainViewModel(BisqSetup bisqSetup, GUIUtil.setPreferences(preferences); setupHandlers(); - bisqSetup.addBisqSetupCompleteListener(this); + bisqSetup.addBisqSetupListener(this); } /////////////////////////////////////////////////////////////////////////////////////////// - // BisqSetupCompleteListener + // BisqSetupListener /////////////////////////////////////////////////////////////////////////////////////////// @Override From fb9f59db9505d5bff173597cc0b1d64f90df6bdc Mon Sep 17 00:00:00 2001 From: Manfred Karrer Date: Wed, 16 Jan 2019 12:09:11 +0100 Subject: [PATCH 12/27] Start server at onInitWallet and add wallet password handler - Add onInitWallet to HttpApiMain and start http server there - Add onRequestWalletPassword to BisqSetupListener - Override setupHandlers in HttpApiHeadlessApp and adjust setRequestWalletPasswordHandler (impl. missing) - Add onRequestWalletPassword to HttpApiMain --- core/src/main/java/bisq/core/app/BisqHeadlessApp.java | 2 +- core/src/main/java/bisq/core/app/BisqSetup.java | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/core/src/main/java/bisq/core/app/BisqHeadlessApp.java b/core/src/main/java/bisq/core/app/BisqHeadlessApp.java index 22c23deccf3..c77acd6d7c5 100644 --- a/core/src/main/java/bisq/core/app/BisqHeadlessApp.java +++ b/core/src/main/java/bisq/core/app/BisqHeadlessApp.java @@ -43,7 +43,7 @@ public class BisqHeadlessApp implements HeadlessApp { @Setter private GracefulShutDownHandler gracefulShutDownHandler; private boolean shutDownRequested; - private BisqSetup bisqSetup; + protected BisqSetup bisqSetup; private CorruptedDatabaseFilesHandler corruptedDatabaseFilesHandler; private TradeManager tradeManager; diff --git a/core/src/main/java/bisq/core/app/BisqSetup.java b/core/src/main/java/bisq/core/app/BisqSetup.java index eb62d15cef4..cd9a11ed630 100644 --- a/core/src/main/java/bisq/core/app/BisqSetup.java +++ b/core/src/main/java/bisq/core/app/BisqSetup.java @@ -125,6 +125,10 @@ default void onInitWallet() { log.info("onInitWallet"); } + default void onRequestWalletPassword() { + log.info("onRequestWalletPassword"); + } + void onSetupComplete(); } @@ -561,6 +565,8 @@ else if (displayTorNetworkSettingsHandler != null) private void initWallet() { bisqSetupListeners.forEach(BisqSetupListener::onInitWallet); Runnable walletPasswordHandler = () -> { + log.info("Wallet password required"); + bisqSetupListeners.forEach(BisqSetupListener::onRequestWalletPassword); if (p2pNetworkReady.get()) p2PNetworkSetup.setSplashP2PNetworkAnimationVisible(true); @@ -571,6 +577,9 @@ private void initWallet() { if (showFirstPopupIfResyncSPVRequestedHandler != null) showFirstPopupIfResyncSPVRequestedHandler.run(); } else { + // TODO no guarantee here that the wallet is really fully initialized + // We would need a new walletInitializedButNotEncrypted state to track + // Usually init is fast and we have our wallet initialized at that state though. walletInitialized.set(true); } }); From 5ecc8970112d69405a1500bfed354a3f9a4404fa Mon Sep 17 00:00:00 2001 From: wiz Date: Wed, 9 Oct 2019 00:44:25 +0900 Subject: [PATCH 13/27] Add combination (Blockstream.info + Mempool.space) block explorer --- core/src/main/java/bisq/core/user/Preferences.java | 1 + 1 file changed, 1 insertion(+) diff --git a/core/src/main/java/bisq/core/user/Preferences.java b/core/src/main/java/bisq/core/user/Preferences.java index 4d575029d24..71019d4c606 100644 --- a/core/src/main/java/bisq/core/user/Preferences.java +++ b/core/src/main/java/bisq/core/user/Preferences.java @@ -83,6 +83,7 @@ public final class Preferences implements PersistedDataHost, BridgeAddressProvid private static final ArrayList BTC_MAIN_NET_EXPLORERS = new ArrayList<>(Arrays.asList( new BlockChainExplorer("Blockstream.info", "https://blockstream.info/tx/", "https://blockstream.info/address/"), new BlockChainExplorer("Blockstream.info Tor V3", "http://explorerzydxu5ecjrkwceayqybizmpjjznk5izmitf2modhcusuqlid.onion/tx/", "http://explorerzydxu5ecjrkwceayqybizmpjjznk5izmitf2modhcusuqlid.onion/address/"), + new BlockChainExplorer("Blockstream.info + Mempool.space", "https://mempool.space/tx/", "https://blockstream.info/address/"), new BlockChainExplorer("OXT", "https://oxt.me/transaction/", "https://oxt.me/address/"), new BlockChainExplorer("Bitaps", "https://bitaps.com/", "https://bitaps.com/"), new BlockChainExplorer("Blockcypher", "https://live.blockcypher.com/btc/tx/", "https://live.blockcypher.com/btc/address/"), From 3c1f8a107f132b7b3f800a57bb1f25e000db3d83 Mon Sep 17 00:00:00 2001 From: wiz Date: Wed, 9 Oct 2019 00:46:41 +0900 Subject: [PATCH 14/27] Revert "Temporarily disable onion host for @KanoczTomas's BTC node" This reverts commit d3335208bb20b174bb166cdc78131c2d440e1f81. --- core/src/main/java/bisq/core/btc/nodes/BtcNodes.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/src/main/java/bisq/core/btc/nodes/BtcNodes.java b/core/src/main/java/bisq/core/btc/nodes/BtcNodes.java index 9b20a587745..e7dbcba61be 100644 --- a/core/src/main/java/bisq/core/btc/nodes/BtcNodes.java +++ b/core/src/main/java/bisq/core/btc/nodes/BtcNodes.java @@ -69,7 +69,7 @@ public List getProvidedBtcNodes() { new BtcNode("btc2.sqrrm.net", "i3a5xtzfm4xwtybd.onion", "81.171.22.143", BtcNode.DEFAULT_PORT, "@sqrrm"), // KanoczTomas - new BtcNode("btc.ispol.sk", null, "193.58.196.212", BtcNode.DEFAULT_PORT, "@KanoczTomas"), + new BtcNode("btc.ispol.sk", "mbm6ffx6j5ygi2ck.onion", "193.58.196.212", BtcNode.DEFAULT_PORT, "@KanoczTomas"), // Devin Bileck new BtcNode("btc1.dnsalias.net", "lva54pnbq2nsmjyr.onion", "165.227.34.198", BtcNode.DEFAULT_PORT, "@devinbileck"), From 5babcec38a42d401b981cb627df6bb491ce6fe88 Mon Sep 17 00:00:00 2001 From: wiz Date: Wed, 9 Oct 2019 00:47:18 +0900 Subject: [PATCH 15/27] Temporarily disable KanoczTomas btcnode on both onion and clearnet --- core/src/main/java/bisq/core/btc/nodes/BtcNodes.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/src/main/java/bisq/core/btc/nodes/BtcNodes.java b/core/src/main/java/bisq/core/btc/nodes/BtcNodes.java index e7dbcba61be..5b7c3b661e6 100644 --- a/core/src/main/java/bisq/core/btc/nodes/BtcNodes.java +++ b/core/src/main/java/bisq/core/btc/nodes/BtcNodes.java @@ -68,8 +68,8 @@ public List getProvidedBtcNodes() { new BtcNode("btc1.sqrrm.net", "3r44ddzjitznyahw.onion", "185.25.48.184", BtcNode.DEFAULT_PORT, "@sqrrm"), new BtcNode("btc2.sqrrm.net", "i3a5xtzfm4xwtybd.onion", "81.171.22.143", BtcNode.DEFAULT_PORT, "@sqrrm"), - // KanoczTomas - new BtcNode("btc.ispol.sk", "mbm6ffx6j5ygi2ck.onion", "193.58.196.212", BtcNode.DEFAULT_PORT, "@KanoczTomas"), + // KanoczTomas - temp disabled until he returns + // new BtcNode("btc.ispol.sk", "mbm6ffx6j5ygi2ck.onion", "193.58.196.212", BtcNode.DEFAULT_PORT, "@KanoczTomas"), // Devin Bileck new BtcNode("btc1.dnsalias.net", "lva54pnbq2nsmjyr.onion", "165.227.34.198", BtcNode.DEFAULT_PORT, "@devinbileck"), From a9c24488fd527dac1569d22be305f93417705bc6 Mon Sep 17 00:00:00 2001 From: lukasz Date: Wed, 9 Oct 2019 17:35:58 +0200 Subject: [PATCH 16/27] Refactor BisqApp - update scene size calculation --- desktop/src/main/java/bisq/desktop/app/BisqApp.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/desktop/src/main/java/bisq/desktop/app/BisqApp.java b/desktop/src/main/java/bisq/desktop/app/BisqApp.java index fed66ca5f9e..3afd68bbdb8 100644 --- a/desktop/src/main/java/bisq/desktop/app/BisqApp.java +++ b/desktop/src/main/java/bisq/desktop/app/BisqApp.java @@ -218,10 +218,10 @@ private Scene createAndConfigScene(MainView mainView, Injector injector) { } Scene scene = new Scene(mainView.getRoot(), maxWindowBounds.width < INITIAL_WINDOW_WIDTH ? - (maxWindowBounds.width < MIN_WINDOW_WIDTH ? MIN_WINDOW_WIDTH : maxWindowBounds.width) : + Math.max(maxWindowBounds.width, MIN_WINDOW_WIDTH) : INITIAL_WINDOW_WIDTH, maxWindowBounds.height < INITIAL_WINDOW_HEIGHT ? - (maxWindowBounds.height < MIN_WINDOW_HEIGHT ? MIN_WINDOW_HEIGHT : maxWindowBounds.height) : + Math.max(maxWindowBounds.height, MIN_WINDOW_HEIGHT) : INITIAL_WINDOW_HEIGHT); addSceneKeyEventHandler(scene, injector); From 584e552e9078a792aac47c2937867bee0b6b9863 Mon Sep 17 00:00:00 2001 From: lukasz Date: Wed, 9 Oct 2019 17:58:21 +0200 Subject: [PATCH 17/27] Refactor BisqApp - update error popup message build --- desktop/src/main/java/bisq/desktop/app/BisqApp.java | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/desktop/src/main/java/bisq/desktop/app/BisqApp.java b/desktop/src/main/java/bisq/desktop/app/BisqApp.java index fed66ca5f9e..37da8583054 100644 --- a/desktop/src/main/java/bisq/desktop/app/BisqApp.java +++ b/desktop/src/main/java/bisq/desktop/app/BisqApp.java @@ -73,6 +73,7 @@ import java.awt.GraphicsEnvironment; import java.awt.Rectangle; +import java.util.Objects; import java.util.concurrent.TimeUnit; import java.util.function.Consumer; @@ -180,12 +181,10 @@ public void handleUncaughtException(Throwable throwable, boolean doShutDown) { try { try { if (!popupOpened) { - String message = throwable.getMessage(); popupOpened = true; - if (message != null) - new Popup<>().error(message).onClose(() -> popupOpened = false).show(); - else - new Popup<>().error(throwable.toString()).onClose(() -> popupOpened = false).show(); + new Popup<>().error(Objects.requireNonNullElse(throwable.getMessage(), throwable.toString())) + .onClose(() -> popupOpened = false) + .show(); } } catch (Throwable throwable3) { log.error("Error at displaying Throwable."); From 23877d4b2c906bd000f0f063b1aa22980eac05ce Mon Sep 17 00:00:00 2001 From: lukasz Date: Wed, 9 Oct 2019 18:11:06 +0200 Subject: [PATCH 18/27] Refactor BisqApp - move icon load into ImageUtil --- .../src/main/java/bisq/desktop/app/BisqApp.java | 13 +------------ .../src/main/java/bisq/desktop/util/ImageUtil.java | 14 ++++++++++++++ 2 files changed, 15 insertions(+), 12 deletions(-) diff --git a/desktop/src/main/java/bisq/desktop/app/BisqApp.java b/desktop/src/main/java/bisq/desktop/app/BisqApp.java index fed66ca5f9e..186c472823b 100644 --- a/desktop/src/main/java/bisq/desktop/app/BisqApp.java +++ b/desktop/src/main/java/bisq/desktop/app/BisqApp.java @@ -253,18 +253,7 @@ private void setupStage(Scene scene) { stage.setScene(scene); stage.setMinWidth(MIN_WINDOW_WIDTH); stage.setMinHeight(MIN_WINDOW_HEIGHT); - - // on Windows the title icon is also used as task bar icon in a larger size - // on Linux no title icon is supported but also a large task bar icon is derived from that title icon - String iconPath; - if (Utilities.isOSX()) - iconPath = ImageUtil.isRetina() ? "/images/window_icon@2x.png" : "/images/window_icon.png"; - else if (Utilities.isWindows()) - iconPath = "/images/task_bar_icon_windows.png"; - else - iconPath = "/images/task_bar_icon_linux.png"; - - stage.getIcons().add(new Image(getClass().getResourceAsStream(iconPath))); + stage.getIcons().add(ImageUtil.getApplicationIconImage()); // make the UI visible stage.show(); diff --git a/desktop/src/main/java/bisq/desktop/util/ImageUtil.java b/desktop/src/main/java/bisq/desktop/util/ImageUtil.java index 45114e26418..948dee32094 100644 --- a/desktop/src/main/java/bisq/desktop/util/ImageUtil.java +++ b/desktop/src/main/java/bisq/desktop/util/ImageUtil.java @@ -19,6 +19,8 @@ import bisq.core.locale.Country; +import bisq.common.util.Utilities; + import javafx.scene.image.Image; import javafx.scene.image.ImageView; @@ -40,6 +42,18 @@ public static ImageView getImageViewById(String id) { return imageView; } + public static Image getApplicationIconImage () { + String iconPath; + if (Utilities.isOSX()) + iconPath = ImageUtil.isRetina() ? "/images/window_icon@2x.png" : "/images/window_icon.png"; + else if (Utilities.isWindows()) + iconPath = "/images/task_bar_icon_windows.png"; + else + iconPath = "/images/task_bar_icon_linux.png"; + + return getImageByUrl(iconPath); + } + private static Image getImageByUrl(String url) { return new Image(ImageUtil.class.getResourceAsStream(url)); } From db17fd5c76b17276f755b33d7d26e48af86b6b48 Mon Sep 17 00:00:00 2001 From: lukasz Date: Wed, 9 Oct 2019 18:32:59 +0200 Subject: [PATCH 19/27] Remove unused Utilities --- .../main/java/bisq/common/util/Utilities.java | 140 ------------------ .../java/bisq/common/util/UtilitiesTest.java | 10 -- 2 files changed, 150 deletions(-) diff --git a/common/src/main/java/bisq/common/util/Utilities.java b/common/src/main/java/bisq/common/util/Utilities.java index 11c72ac8a84..9d810853c73 100644 --- a/common/src/main/java/bisq/common/util/Utilities.java +++ b/common/src/main/java/bisq/common/util/Utilities.java @@ -23,7 +23,6 @@ import com.google.gson.ExclusionStrategy; import com.google.gson.FieldAttributes; -import com.google.gson.FieldNamingPolicy; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -50,17 +49,9 @@ import java.net.URI; import java.net.URISyntaxException; -import java.io.ByteArrayInputStream; -import java.io.ByteArrayOutputStream; import java.io.File; import java.io.IOException; -import java.io.ObjectInput; -import java.io.ObjectInputStream; -import java.io.ObjectOutput; -import java.io.ObjectOutputStream; -import java.io.Serializable; -import java.util.Collection; import java.util.Date; import java.util.GregorianCalendar; import java.util.HashSet; @@ -87,9 +78,6 @@ @Slf4j public class Utilities { - private static long lastTimeStamp = System.currentTimeMillis(); - public static final String LB = System.getProperty("line.separator"); - // TODO check out Jackson lib public static String objectToJson(Object object) { Gson gson = new GsonBuilder() @@ -101,10 +89,6 @@ public static String objectToJson(Object object) { return gson.toJson(object); } - public static ListeningExecutorService getListeningSingleThreadExecutor(String name) { - return MoreExecutors.listeningDecorator(getSingleThreadExecutor(name)); - } - public static ListeningExecutorService getSingleThreadExecutor(String name) { final ThreadFactory threadFactory = new ThreadFactoryBuilder() .setNameFormat(name) @@ -279,10 +263,6 @@ && getDesktop().isSupported(Action.OPEN)) { } } - public static String getTmpDir() { - return System.getProperty("java.io.tmpdir"); - } - public static String getDownloadOfHomeDir() { File file = new File(getSystemHomeDirectory() + "/Downloads"); if (file.exists()) @@ -291,13 +271,6 @@ public static String getDownloadOfHomeDir() { return getSystemHomeDirectory(); } - public static void printSystemLoad() { - Runtime runtime = Runtime.getRuntime(); - long free = runtime.freeMemory() / 1024 / 1024; - long total = runtime.totalMemory() / 1024 / 1024; - long used = total - free; - log.info("System load (no. threads/used memory (MB)): " + Thread.activeCount() + "/" + used); - } public static void copyToClipboard(String content) { try { @@ -313,99 +286,6 @@ public static void copyToClipboard(String content) { } } - public static byte[] concatByteArrays(byte[]... arrays) { - int totalLength = 0; - for (byte[] array : arrays) { - totalLength += array.length; - } - - byte[] result = new byte[totalLength]; - int currentIndex = 0; - for (byte[] array : arrays) { - System.arraycopy(array, 0, result, currentIndex, array.length); - currentIndex += array.length; - } - return result; - } - - public static T jsonToObject(String jsonString, Class classOfT) { - Gson gson = new GsonBuilder().setFieldNamingPolicy(FieldNamingPolicy.UPPER_CAMEL_CASE).setPrettyPrinting().create(); - return gson.fromJson(jsonString, classOfT); - } - - public static T deserialize(byte[] data) { - ByteArrayInputStream bis = new ByteArrayInputStream(data); - ObjectInput in = null; - Object result = null; - try { - in = new ObjectInputStream(bis); - result = in.readObject(); - if (!(result instanceof Serializable)) - throw new RuntimeException("Object not of type Serializable"); - } catch (Exception e) { - e.printStackTrace(); - } finally { - try { - bis.close(); - } catch (IOException ex) { - // ignore close exception - } - try { - if (in != null) { - in.close(); - } - } catch (IOException ex) { - // ignore close exception - } - } - //noinspection unchecked,ConstantConditions - return (T) result; - } - - public static byte[] serialize(Serializable object) { - ByteArrayOutputStream bos = new ByteArrayOutputStream(); - ObjectOutput out = null; - byte[] result = null; - try { - out = new ObjectOutputStream(bos); - out.writeObject(object); - out.flush(); - result = bos.toByteArray().clone(); - } catch (IOException e) { - e.printStackTrace(); - } finally { - try { - if (out != null) { - out.close(); - } - } catch (IOException ignore) { - } - try { - bos.close(); - } catch (IOException ignore) { - } - } - return result; - } - - public static T cloneObject(Serializable object) { - return deserialize(serialize(object)); - } - - @SuppressWarnings("SameParameterValue") - private static void printElapsedTime(String msg) { - if (!msg.isEmpty()) { - msg += " / "; - } - long timeStamp = System.currentTimeMillis(); - log.debug(msg + "Elapsed: " + String.valueOf(timeStamp - lastTimeStamp)); - lastTimeStamp = timeStamp; - } - - public static void printElapsedTime() { - printElapsedTime(""); - } - public static void setThreadName(String name) { Thread.currentThread().setName(name + "-" + new Random().nextInt(10000)); } @@ -454,18 +334,6 @@ public static byte[] concatenateByteArrays(byte[] array1, byte[] array2) { return ArrayUtils.addAll(array1, array2); } - public static byte[] concatenateByteArrays(byte[] array1, byte[] array2, byte[] array3) { - return ArrayUtils.addAll(array1, ArrayUtils.addAll(array2, array3)); - } - - public static byte[] concatenateByteArrays(byte[] array1, byte[] array2, byte[] array3, byte[] array4) { - return ArrayUtils.addAll(array1, ArrayUtils.addAll(array2, ArrayUtils.addAll(array3, array4))); - } - - public static byte[] concatenateByteArrays(byte[] array1, byte[] array2, byte[] array3, byte[] array4, byte[] array5) { - return ArrayUtils.addAll(array1, ArrayUtils.addAll(array2, ArrayUtils.addAll(array3, ArrayUtils.addAll(array4, array5)))); - } - public static Date getUTCDate(int year, int month, int dayOfMonth) { GregorianCalendar calendar = new GregorianCalendar(year, month, dayOfMonth); calendar.setTimeZone(TimeZone.getTimeZone("UTC")); @@ -520,10 +388,6 @@ public static String toTruncatedString(Object message, int maxLength) { return toTruncatedString(message, maxLength, true); } - public static String toTruncatedString(Object message, boolean removeLinebreaks) { - return toTruncatedString(message, 200, removeLinebreaks); - } - public static String toTruncatedString(Object message, int maxLength, boolean removeLinebreaks) { if (message == null) return "null"; @@ -579,10 +443,6 @@ public static String getShortId(String id, String sep) { return id.substring(0, Math.min(8, id.length())); } - public static String collectionToCSV(Collection collection) { - return collection.stream().map(Object::toString).collect(Collectors.joining(",")); - } - public static byte[] integerToByteArray(int intValue, int numBytes) { byte[] bytes = new byte[numBytes]; for (int i = numBytes - 1; i >= 0; i--) { diff --git a/common/src/test/java/bisq/common/util/UtilitiesTest.java b/common/src/test/java/bisq/common/util/UtilitiesTest.java index 22dab34f1c4..7c315d70c20 100644 --- a/common/src/test/java/bisq/common/util/UtilitiesTest.java +++ b/common/src/test/java/bisq/common/util/UtilitiesTest.java @@ -17,8 +17,6 @@ package bisq.common.util; -import java.util.Arrays; - import org.junit.Test; import static org.junit.Assert.assertEquals; @@ -26,14 +24,6 @@ public class UtilitiesTest { - @Test - public void testConcatenateByteArrays() { - assertTrue(Arrays.equals(new byte[]{0x01, 0x02}, Utilities.concatenateByteArrays(new byte[]{0x01}, new byte[]{0x02}))); - assertTrue(Arrays.equals(new byte[]{0x01, 0x02, 0x03}, Utilities.concatenateByteArrays(new byte[]{0x01}, new byte[]{0x02}, new byte[]{0x03}))); - assertTrue(Arrays.equals(new byte[]{0x01, 0x02, 0x03, 0x04}, Utilities.concatenateByteArrays(new byte[]{0x01}, new byte[]{0x02}, new byte[]{0x03}, new byte[]{0x04}))); - assertTrue(Arrays.equals(new byte[]{0x01, 0x02, 0x03, 0x04, 0x05}, Utilities.concatenateByteArrays(new byte[]{0x01}, new byte[]{0x02}, new byte[]{0x03}, new byte[]{0x04}, new byte[]{0x05}))); - } - @Test public void testToStringList() { assertTrue(Utilities.commaSeparatedListToSet(null, false).isEmpty()); From 679985d82edbb7fbeb1809d8b4e38c9faa5362e0 Mon Sep 17 00:00:00 2001 From: wiz Date: Thu, 10 Oct 2019 19:55:20 +0900 Subject: [PATCH 20/27] Increase minimum TX fee to 2 sats/vByte to fix #3106 (#3387) --- core/src/main/java/bisq/core/btc/BaseCurrencyNetwork.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/src/main/java/bisq/core/btc/BaseCurrencyNetwork.java b/core/src/main/java/bisq/core/btc/BaseCurrencyNetwork.java index c4468563299..8981f41426d 100644 --- a/core/src/main/java/bisq/core/btc/BaseCurrencyNetwork.java +++ b/core/src/main/java/bisq/core/btc/BaseCurrencyNetwork.java @@ -73,6 +73,6 @@ public boolean isRegtest() { } public long getDefaultMinFeePerByte() { - return 1; + return 2; } } From ccfbf6f0dadfe718a696d203da9decc734b82012 Mon Sep 17 00:00:00 2001 From: Christoph Atteneder Date: Thu, 10 Oct 2019 14:57:16 +0200 Subject: [PATCH 21/27] Fix mistakes in English source (#3386) * Fix broken placeholders * Replace non existing pending trades screen with open trades screen * Update core/src/main/resources/i18n/displayStrings.properties Co-Authored-By: Steve Jain * Update message in failed trade popup --- .../main/resources/i18n/displayStrings.properties | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/core/src/main/resources/i18n/displayStrings.properties b/core/src/main/resources/i18n/displayStrings.properties index aae6f7ad16a..2173fe5a929 100644 --- a/core/src/main/resources/i18n/displayStrings.properties +++ b/core/src/main/resources/i18n/displayStrings.properties @@ -789,9 +789,8 @@ portfolio.pending.disputeOpenedMyUser=You opened already a dispute.\n{0} portfolio.pending.disputeOpenedByPeer=Your trading peer opened a dispute\n{0} portfolio.pending.supportTicketOpenedByPeer=Your trading peer opened a support ticket.\n{0} portfolio.pending.noReceiverAddressDefined=No receiver address defined -portfolio.pending.removeFailedTrade=If the mediator or arbitrator could not close that trade you can move it yourself \ - to the failed trades screen.\n\ - Do you want to remove that failed trade from the Pending trades screen? +portfolio.pending.removeFailedTrade=Is this a failed trade? If so, would you like to manually \ + close it, so that it no longer shows as an open trade? portfolio.pending.mediationResult.headline=Suggested payout from mediation portfolio.pending.mediationResult.info.noneAccepted=Complete the trade by accepting the mediator's suggestion for the trade payout. @@ -944,7 +943,7 @@ support.sellerTaker=BTC seller/Taker # TODO @m52go could you provide a good text here? support.backgroundInfo=Bisq is not a company, so it handles disputes differently.\n\n\ -Traders can communicate within the application via a secure chat on the pending trades screen to attempt solving a dispute on their own. \ +Traders can communicate within the application via a secure chat on the open trades screen to attempt solving a dispute on their own. \ If that is not sufficient, a mediator can step in to help. The mediator will evaluate the situation and give a recommendation for the \ payout of the trade funds. If both traders accept this suggestion, the payout transaction is completed and the trade is closed. \ If one or both traders do not agree to the mediator's recommended payout, they can request arbitration.\ @@ -962,7 +961,7 @@ support.initialInfo=Please enter a description of your problem in the text field \t Sometimes the data directory gets corrupted and leads to strange bugs. \n\ \t See: https://docs.bisq.network/backup-recovery.html#switch-to-a-new-data-directory\n\n\ Please make yourself familiar with the basic rules for the dispute process:\n\ -\t● You need to respond to the {0}}''s requests within 2 days.\n\ +\t● You need to respond to the {0}''s requests within 2 days.\n\ \t● Mediators respond in between 2 days. Arbitrators respond in between 5 business days.\n\ \t● The maximum period for a dispute is 14 days.\n\ \t● You need to cooperate with the {1} and provide the information they request to make your case.\n\ @@ -1129,7 +1128,7 @@ account.arbitratorRegistration.pubKey=Public key account.arbitratorRegistration.register=Register account.arbitratorRegistration.registration={0} registration account.arbitratorRegistration.revoke=Revoke -account.arbitratorRegistration.info.msg=Please note that you need to stay available for 15 days after revoking as there might be trades which are using you as {0}}. The max. allowed trade period is 8 days and the dispute process might take up to 7 days. +account.arbitratorRegistration.info.msg=Please note that you need to stay available for 15 days after revoking as there might be trades which are using you as {0}. The max. allowed trade period is 8 days and the dispute process might take up to 7 days. account.arbitratorRegistration.warn.min1Language=You need to set at least 1 language.\nWe added the default language for you. account.arbitratorRegistration.removedSuccess=You have successfully removed your registration from the Bisq network. account.arbitratorRegistration.removedFailed=Could not remove registration.{0} @@ -2441,7 +2440,7 @@ popup.warning.lockedUpFunds=You have locked up funds from a failed trade.\n\ Locked up balance: {0} \n\ Deposit tx address: {1}\n\ Trade ID: {2}.\n\n\ - Please open a support ticket by selecting the trade in the pending trades screen and clicking \"alt + o\" or \"option + o\"." + Please open a support ticket by selecting the trade in the open trades screen and pressing \"alt + o\" or \"option + o\"." popup.warning.nodeBanned=One of the {0} nodes got banned. Please restart your application to be sure to not be connected to the banned node. popup.warning.priceRelay=price relay From d8dd01403f8965bf58c6e115a6adf97a4b60f116 Mon Sep 17 00:00:00 2001 From: lukasz Date: Thu, 3 Oct 2019 19:24:24 +0200 Subject: [PATCH 22/27] Refactor BisqEnvironment --- .../java/bisq/core/app/BisqEnvironment.java | 198 +++++------------- 1 file changed, 57 insertions(+), 141 deletions(-) diff --git a/core/src/main/java/bisq/core/app/BisqEnvironment.java b/core/src/main/java/bisq/core/app/BisqEnvironment.java index 2c542bc64c3..23d93760f54 100644 --- a/core/src/main/java/bisq/core/app/BisqEnvironment.java +++ b/core/src/main/java/bisq/core/app/BisqEnvironment.java @@ -206,155 +206,67 @@ public BisqEnvironment(OptionSet options) { @SuppressWarnings("ConstantConditions") public BisqEnvironment(PropertySource commandLineProperties) { //CommonOptionKeys - logLevel = commandLineProperties.containsProperty(CommonOptionKeys.LOG_LEVEL_KEY) ? - (String) commandLineProperties.getProperty(CommonOptionKeys.LOG_LEVEL_KEY) : - LOG_LEVEL_DEFAULT; + logLevel = getProperty(commandLineProperties, CommonOptionKeys.LOG_LEVEL_KEY, LOG_LEVEL_DEFAULT); + useDevMode = getProperty(commandLineProperties, CommonOptionKeys.USE_DEV_MODE, ""); //AppOptionKeys - userDataDir = commandLineProperties.containsProperty(AppOptionKeys.USER_DATA_DIR_KEY) ? - (String) commandLineProperties.getProperty(AppOptionKeys.USER_DATA_DIR_KEY) : - DEFAULT_USER_DATA_DIR; - - appName = commandLineProperties.containsProperty(AppOptionKeys.APP_NAME_KEY) ? - (String) commandLineProperties.getProperty(AppOptionKeys.APP_NAME_KEY) : - DEFAULT_APP_NAME; - - appDataDir = commandLineProperties.containsProperty(AppOptionKeys.APP_DATA_DIR_KEY) ? - (String) commandLineProperties.getProperty(AppOptionKeys.APP_DATA_DIR_KEY) : - appDataDir(userDataDir, appName); + userDataDir = getProperty(commandLineProperties, AppOptionKeys.USER_DATA_DIR_KEY, DEFAULT_USER_DATA_DIR); + appName = getProperty(commandLineProperties, AppOptionKeys.APP_NAME_KEY, DEFAULT_APP_NAME); + appDataDir = getProperty(commandLineProperties, AppOptionKeys.APP_DATA_DIR_KEY, appDataDir(userDataDir, appName)); staticAppDataDir = appDataDir; - desktopWithHttpApi = commandLineProperties.containsProperty(AppOptionKeys.DESKTOP_WITH_HTTP_API) ? - (String) commandLineProperties.getProperty(AppOptionKeys.DESKTOP_WITH_HTTP_API) : - "false"; - desktopWithGrpcApi = commandLineProperties.containsProperty(AppOptionKeys.DESKTOP_WITH_GRPC_API) ? - (String) commandLineProperties.getProperty(AppOptionKeys.DESKTOP_WITH_GRPC_API) : - "false"; - ignoreDevMsg = commandLineProperties.containsProperty(AppOptionKeys.IGNORE_DEV_MSG_KEY) ? - (String) commandLineProperties.getProperty(AppOptionKeys.IGNORE_DEV_MSG_KEY) : - ""; - useDevPrivilegeKeys = commandLineProperties.containsProperty(AppOptionKeys.USE_DEV_PRIVILEGE_KEYS) ? - (String) commandLineProperties.getProperty(AppOptionKeys.USE_DEV_PRIVILEGE_KEYS) : - ""; - referralId = commandLineProperties.containsProperty(AppOptionKeys.REFERRAL_ID) ? - (String) commandLineProperties.getProperty(AppOptionKeys.REFERRAL_ID) : - ""; - useDevMode = commandLineProperties.containsProperty(CommonOptionKeys.USE_DEV_MODE) ? - (String) commandLineProperties.getProperty(CommonOptionKeys.USE_DEV_MODE) : - ""; - dumpStatistics = commandLineProperties.containsProperty(AppOptionKeys.DUMP_STATISTICS) ? - (String) commandLineProperties.getProperty(AppOptionKeys.DUMP_STATISTICS) : - ""; - maxMemory = commandLineProperties.containsProperty(AppOptionKeys.MAX_MEMORY) ? - (String) commandLineProperties.getProperty(AppOptionKeys.MAX_MEMORY) : - ""; - providers = commandLineProperties.containsProperty(AppOptionKeys.PROVIDERS) ? - (String) commandLineProperties.getProperty(AppOptionKeys.PROVIDERS) : - ""; + desktopWithHttpApi = getProperty(commandLineProperties, AppOptionKeys.DESKTOP_WITH_HTTP_API, "false"); + desktopWithGrpcApi = getProperty(commandLineProperties, AppOptionKeys.DESKTOP_WITH_GRPC_API, "false"); + ignoreDevMsg = getProperty(commandLineProperties, AppOptionKeys.IGNORE_DEV_MSG_KEY, ""); + useDevPrivilegeKeys = getProperty(commandLineProperties, AppOptionKeys.USE_DEV_PRIVILEGE_KEYS, ""); + referralId = getProperty(commandLineProperties, AppOptionKeys.REFERRAL_ID, ""); + dumpStatistics = getProperty(commandLineProperties, AppOptionKeys.DUMP_STATISTICS, ""); + maxMemory = getProperty(commandLineProperties, AppOptionKeys.MAX_MEMORY, ""); + providers = getProperty(commandLineProperties, AppOptionKeys.PROVIDERS, ""); //NetworkOptionKeys - seedNodes = commandLineProperties.containsProperty(NetworkOptionKeys.SEED_NODES_KEY) ? - (String) commandLineProperties.getProperty(NetworkOptionKeys.SEED_NODES_KEY) : - ""; - - banList = commandLineProperties.containsProperty(NetworkOptionKeys.BAN_LIST) ? - (String) commandLineProperties.getProperty(NetworkOptionKeys.BAN_LIST) : - ""; - socks5ProxyBtcAddress = commandLineProperties.containsProperty(NetworkOptionKeys.SOCKS_5_PROXY_BTC_ADDRESS) ? - (String) commandLineProperties.getProperty(NetworkOptionKeys.SOCKS_5_PROXY_BTC_ADDRESS) : - ""; - socks5ProxyHttpAddress = commandLineProperties.containsProperty(NetworkOptionKeys.SOCKS_5_PROXY_HTTP_ADDRESS) ? - (String) commandLineProperties.getProperty(NetworkOptionKeys.SOCKS_5_PROXY_HTTP_ADDRESS) : - ""; - torRcFile = commandLineProperties.containsProperty(NetworkOptionKeys.TORRC_FILE) ? - (String) commandLineProperties.getProperty(NetworkOptionKeys.TORRC_FILE) : - ""; - torRcOptions = commandLineProperties.containsProperty(NetworkOptionKeys.TORRC_OPTIONS) ? - (String) commandLineProperties.getProperty(NetworkOptionKeys.TORRC_OPTIONS) : - ""; - externalTorControlPort = commandLineProperties.containsProperty(NetworkOptionKeys.EXTERNAL_TOR_CONTROL_PORT) ? - (String) commandLineProperties.getProperty(NetworkOptionKeys.EXTERNAL_TOR_CONTROL_PORT) : - ""; - externalTorPassword = commandLineProperties.containsProperty(NetworkOptionKeys.EXTERNAL_TOR_PASSWORD) ? - (String) commandLineProperties.getProperty(NetworkOptionKeys.EXTERNAL_TOR_PASSWORD) : - ""; - externalTorCookieFile = commandLineProperties.containsProperty(NetworkOptionKeys.EXTERNAL_TOR_COOKIE_FILE) ? - (String) commandLineProperties.getProperty(NetworkOptionKeys.EXTERNAL_TOR_COOKIE_FILE) : - ""; + seedNodes = getProperty(commandLineProperties, NetworkOptionKeys.SEED_NODES_KEY, ""); + banList = getProperty(commandLineProperties, NetworkOptionKeys.BAN_LIST, ""); + socks5ProxyBtcAddress = getProperty(commandLineProperties, NetworkOptionKeys.SOCKS_5_PROXY_BTC_ADDRESS, ""); + socks5ProxyHttpAddress = getProperty(commandLineProperties, NetworkOptionKeys.SOCKS_5_PROXY_HTTP_ADDRESS, ""); + torRcFile = getProperty(commandLineProperties, NetworkOptionKeys.TORRC_FILE, ""); + torRcOptions = getProperty(commandLineProperties, NetworkOptionKeys.TORRC_OPTIONS, ""); + externalTorControlPort = getProperty(commandLineProperties, NetworkOptionKeys.EXTERNAL_TOR_CONTROL_PORT, ""); + externalTorPassword = getProperty(commandLineProperties, NetworkOptionKeys.EXTERNAL_TOR_PASSWORD, ""); + externalTorCookieFile = getProperty(commandLineProperties, NetworkOptionKeys.EXTERNAL_TOR_COOKIE_FILE, ""); externalTorUseSafeCookieAuthentication = commandLineProperties.containsProperty(NetworkOptionKeys.EXTERNAL_TOR_USE_SAFECOOKIE); torStreamIsolation = commandLineProperties.containsProperty(NetworkOptionKeys.TOR_STREAM_ISOLATION); - msgThrottlePerSec = commandLineProperties.containsProperty(NetworkOptionKeys.MSG_THROTTLE_PER_SEC) ? - (String) commandLineProperties.getProperty(NetworkOptionKeys.MSG_THROTTLE_PER_SEC) : - String.valueOf(ConnectionConfig.MSG_THROTTLE_PER_SEC); - msgThrottlePer10Sec = commandLineProperties.containsProperty(NetworkOptionKeys.MSG_THROTTLE_PER_10_SEC) ? - (String) commandLineProperties.getProperty(NetworkOptionKeys.MSG_THROTTLE_PER_10_SEC) : - String.valueOf(ConnectionConfig.MSG_THROTTLE_PER_10_SEC); - sendMsgThrottleTrigger = commandLineProperties.containsProperty(NetworkOptionKeys.SEND_MSG_THROTTLE_TRIGGER) ? - (String) commandLineProperties.getProperty(NetworkOptionKeys.SEND_MSG_THROTTLE_TRIGGER) : - String.valueOf(ConnectionConfig.SEND_MSG_THROTTLE_TRIGGER); - sendMsgThrottleSleep = commandLineProperties.containsProperty(NetworkOptionKeys.SEND_MSG_THROTTLE_SLEEP) ? - (String) commandLineProperties.getProperty(NetworkOptionKeys.SEND_MSG_THROTTLE_SLEEP) : - String.valueOf(ConnectionConfig.SEND_MSG_THROTTLE_SLEEP); - - //RpcOptionKeys - rpcUser = commandLineProperties.containsProperty(DaoOptionKeys.RPC_USER) ? - (String) commandLineProperties.getProperty(DaoOptionKeys.RPC_USER) : - ""; - rpcPassword = commandLineProperties.containsProperty(DaoOptionKeys.RPC_PASSWORD) ? - (String) commandLineProperties.getProperty(DaoOptionKeys.RPC_PASSWORD) : - ""; - rpcHost = commandLineProperties.containsProperty(DaoOptionKeys.RPC_HOST) ? - (String) commandLineProperties.getProperty(DaoOptionKeys.RPC_HOST) : - ""; - rpcPort = commandLineProperties.containsProperty(DaoOptionKeys.RPC_PORT) ? - (String) commandLineProperties.getProperty(DaoOptionKeys.RPC_PORT) : - ""; - rpcBlockNotificationPort = commandLineProperties.containsProperty(DaoOptionKeys.RPC_BLOCK_NOTIFICATION_PORT) ? - (String) commandLineProperties.getProperty(DaoOptionKeys.RPC_BLOCK_NOTIFICATION_PORT) : - ""; - rpcBlockNotificationHost = commandLineProperties.containsProperty(DaoOptionKeys.RPC_BLOCK_NOTIFICATION_HOST) ? - (String) commandLineProperties.getProperty(DaoOptionKeys.RPC_BLOCK_NOTIFICATION_HOST) : - ""; - dumpBlockchainData = commandLineProperties.containsProperty(DaoOptionKeys.DUMP_BLOCKCHAIN_DATA) ? - (String) commandLineProperties.getProperty(DaoOptionKeys.DUMP_BLOCKCHAIN_DATA) : - ""; - fullDaoNode = commandLineProperties.containsProperty(DaoOptionKeys.FULL_DAO_NODE) ? - (String) commandLineProperties.getProperty(DaoOptionKeys.FULL_DAO_NODE) : - ""; - genesisTxId = commandLineProperties.containsProperty(DaoOptionKeys.GENESIS_TX_ID) ? - (String) commandLineProperties.getProperty(DaoOptionKeys.GENESIS_TX_ID) : - ""; - genesisBlockHeight = commandLineProperties.containsProperty(DaoOptionKeys.GENESIS_BLOCK_HEIGHT) ? - (String) commandLineProperties.getProperty(DaoOptionKeys.GENESIS_BLOCK_HEIGHT) : - "-1"; - genesisTotalSupply = commandLineProperties.containsProperty(DaoOptionKeys.GENESIS_TOTAL_SUPPLY) ? - (String) commandLineProperties.getProperty(DaoOptionKeys.GENESIS_TOTAL_SUPPLY) : - "-1"; - daoActivated = commandLineProperties.containsProperty(DaoOptionKeys.DAO_ACTIVATED) ? - (String) commandLineProperties.getProperty(DaoOptionKeys.DAO_ACTIVATED) : - "true"; - - btcNodes = commandLineProperties.containsProperty(BtcOptionKeys.BTC_NODES) ? - (String) commandLineProperties.getProperty(BtcOptionKeys.BTC_NODES) : - ""; - - useTorForBtc = commandLineProperties.containsProperty(BtcOptionKeys.USE_TOR_FOR_BTC) ? - (String) commandLineProperties.getProperty(BtcOptionKeys.USE_TOR_FOR_BTC) : - ""; - userAgent = commandLineProperties.containsProperty(BtcOptionKeys.USER_AGENT) ? - (String) commandLineProperties.getProperty(BtcOptionKeys.USER_AGENT) : - "Bisq"; - useAllProvidedNodes = commandLineProperties.containsProperty(BtcOptionKeys.USE_ALL_PROVIDED_NODES) ? - (String) commandLineProperties.getProperty(BtcOptionKeys.USE_ALL_PROVIDED_NODES) : - "false"; - numConnectionForBtc = commandLineProperties.containsProperty(BtcOptionKeys.NUM_CONNECTIONS_FOR_BTC) ? - (String) commandLineProperties.getProperty(BtcOptionKeys.NUM_CONNECTIONS_FOR_BTC) : - "9"; - ignoreLocalBtcNode = commandLineProperties.containsProperty(BtcOptionKeys.IGNORE_LOCAL_BTC_NODE) ? - (String) commandLineProperties.getProperty(BtcOptionKeys.IGNORE_LOCAL_BTC_NODE) : - "false"; - - MutablePropertySources propertySources = this.getPropertySources(); + + msgThrottlePerSec = getProperty(commandLineProperties, NetworkOptionKeys.MSG_THROTTLE_PER_SEC, String.valueOf(ConnectionConfig.MSG_THROTTLE_PER_SEC)); + msgThrottlePer10Sec = getProperty(commandLineProperties, NetworkOptionKeys.MSG_THROTTLE_PER_10_SEC, String.valueOf(ConnectionConfig.MSG_THROTTLE_PER_10_SEC)); + sendMsgThrottleTrigger = getProperty(commandLineProperties, NetworkOptionKeys.SEND_MSG_THROTTLE_TRIGGER, String.valueOf(ConnectionConfig.SEND_MSG_THROTTLE_TRIGGER)); + sendMsgThrottleSleep = getProperty(commandLineProperties, NetworkOptionKeys.SEND_MSG_THROTTLE_SLEEP, String.valueOf(ConnectionConfig.SEND_MSG_THROTTLE_SLEEP)); + + + //DaoOptionKeys + rpcUser = getProperty(commandLineProperties, DaoOptionKeys.RPC_USER, ""); + rpcPassword = getProperty(commandLineProperties, DaoOptionKeys.RPC_PASSWORD, ""); + rpcHost = getProperty(commandLineProperties, DaoOptionKeys.RPC_HOST, ""); + rpcPort = getProperty(commandLineProperties, DaoOptionKeys.RPC_PORT, ""); + rpcBlockNotificationPort = getProperty(commandLineProperties, DaoOptionKeys.RPC_BLOCK_NOTIFICATION_PORT, ""); + rpcBlockNotificationHost = getProperty(commandLineProperties, DaoOptionKeys.RPC_BLOCK_NOTIFICATION_HOST, ""); + dumpBlockchainData = getProperty(commandLineProperties, DaoOptionKeys.DUMP_BLOCKCHAIN_DATA, ""); + fullDaoNode = getProperty(commandLineProperties, DaoOptionKeys.FULL_DAO_NODE, ""); + genesisTxId = getProperty(commandLineProperties, DaoOptionKeys.GENESIS_TX_ID, ""); + genesisBlockHeight = getProperty(commandLineProperties, DaoOptionKeys.GENESIS_BLOCK_HEIGHT, "-1"); + genesisTotalSupply = getProperty(commandLineProperties, DaoOptionKeys.GENESIS_TOTAL_SUPPLY, "-1"); + daoActivated = getProperty(commandLineProperties, DaoOptionKeys.DAO_ACTIVATED, "true"); + + //BtcOptionKeys + btcNodes = getProperty(commandLineProperties, BtcOptionKeys.BTC_NODES, ""); + useTorForBtc = getProperty(commandLineProperties, BtcOptionKeys.USE_TOR_FOR_BTC, ""); + userAgent = getProperty(commandLineProperties, BtcOptionKeys.USER_AGENT, "Bisq"); + useAllProvidedNodes = getProperty(commandLineProperties, BtcOptionKeys.USE_ALL_PROVIDED_NODES, "false"); + numConnectionForBtc = getProperty(commandLineProperties, BtcOptionKeys.NUM_CONNECTIONS_FOR_BTC, "9"); + ignoreLocalBtcNode = getProperty(commandLineProperties, BtcOptionKeys.IGNORE_LOCAL_BTC_NODE, "false"); + + + MutablePropertySources propertySources = getPropertySources(); propertySources.addFirst(commandLineProperties); try { propertySources.addLast(getAppDirProperties()); @@ -458,6 +370,10 @@ PropertySource getAppDirProperties() throws Exception { return new ResourcePropertySource(BISQ_APP_DIR_PROPERTY_SOURCE_NAME, resource); } + private String getProperty (PropertySource properties, String propertyKey, String defaultValue) { + return properties.containsProperty(propertyKey) ? (String) properties.getProperty(propertyKey) : defaultValue; + } + private PropertySource defaultProperties() { return new PropertiesPropertySource(BISQ_DEFAULT_PROPERTY_SOURCE_NAME, new Properties() { { From 1e40bb0f0631f37b468f78ef724d60f28ceec5eb Mon Sep 17 00:00:00 2001 From: Peter Goodspeed-Niklaus Date: Mon, 19 Aug 2019 11:53:14 +0200 Subject: [PATCH 23/27] List Ndau (XND) - Official project URL: https://ndau.io/ - Official block explorer URL: https://explorer.service.ndau.tech --- .../src/main/java/bisq/asset/coins/Ndau.java | 37 ++++++++++++++ .../META-INF/services/bisq.asset.Asset | 1 + .../test/java/bisq/asset/coins/NdauTest.java | 50 +++++++++++++++++++ 3 files changed, 88 insertions(+) create mode 100644 assets/src/main/java/bisq/asset/coins/Ndau.java create mode 100644 assets/src/test/java/bisq/asset/coins/NdauTest.java diff --git a/assets/src/main/java/bisq/asset/coins/Ndau.java b/assets/src/main/java/bisq/asset/coins/Ndau.java new file mode 100644 index 00000000000..2cb6e8ac302 --- /dev/null +++ b/assets/src/main/java/bisq/asset/coins/Ndau.java @@ -0,0 +1,37 @@ +/* + * 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 . + */ + +/* + * Copyright © 2019 Oneiro NA, Inc. + */ + +package bisq.asset.coins; + +import bisq.asset.Coin; +import bisq.asset.RegexAddressValidator; + + +public class Ndau extends Coin { + + public Ndau() { + // note: ndau addresses contain an internal checksum which was deemed too complicated to include here. + // this regex performs superficial validation, but there is a large space of addresses marked valid + // by this regex which are not in fact valid ndau addresses. For actual ndau address validation, + // use the Address class in github.com/oneiro-ndev/ndauj (java) or github.com/oneiro-ndev/ndaumath/pkg/address (go). + super("ndau", "XND", new RegexAddressValidator("nd[anexbm][abcdefghijkmnpqrstuvwxyz23456789]{45}")); + } +} diff --git a/assets/src/main/resources/META-INF/services/bisq.asset.Asset b/assets/src/main/resources/META-INF/services/bisq.asset.Asset index 33c63a2a430..bf0be43c6ff 100644 --- a/assets/src/main/resources/META-INF/services/bisq.asset.Asset +++ b/assets/src/main/resources/META-INF/services/bisq.asset.Asset @@ -71,6 +71,7 @@ bisq.asset.coins.MoX bisq.asset.coins.Myce bisq.asset.coins.Namecoin bisq.asset.coins.Navcoin +bisq.asset.coins.Ndau bisq.asset.coins.Noir bisq.asset.coins.ParsiCoin bisq.asset.coins.Particl diff --git a/assets/src/test/java/bisq/asset/coins/NdauTest.java b/assets/src/test/java/bisq/asset/coins/NdauTest.java new file mode 100644 index 00000000000..5efa400319e --- /dev/null +++ b/assets/src/test/java/bisq/asset/coins/NdauTest.java @@ -0,0 +1,50 @@ +/* + * 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 . + */ + +/* + * Copyright © 2019 Oneiro NA, Inc. + */ + +package bisq.asset.coins; + +import bisq.asset.AbstractAssetTest; + +import org.junit.Test; + +public class NdauTest extends AbstractAssetTest { + public NdauTest() {super(new Ndau());} + + @Test + public void testValidAddresses() { + assertValidAddress("ndaaacj4gbv5xgwikt6adcujqyvd37ksadj4mg9v3jqtbe9f"); + assertValidAddress("ndnbeju3vmcxf9n96rb652eaeri79anqz47budnw8vwv3nyv"); + assertValidAddress("ndeatpdkx5stu28n3v6pie96bma5k8pzbvbdpu8dchyn46nw"); + assertValidAddress("ndxix97gyubjrkqbu4a5m3kpxyz4qhap3c3ui7359pzskwv4"); + assertValidAddress("ndbjhkkcvj88beqcamr439z6d6icm5mjwth5r7vrgfbnxktr"); + assertValidAddress("ndmpdkab97bi4ea73scjh6xpt8njjjhha4rarpr2zzzrv88u"); + } + + @Test + public void testInvalidAddresses() { + assertInvalidAddress("ndaaacj4gbv5xgwikt6adcujqyvd37ksadj4mg9v3jqtbe9"); + assertInvalidAddress("ndnbeju3vmcxf9n96rb652eaeri79anqz47budnw8vwv3nyvw"); + assertInvalidAddress("ndpatpdkx5stu28n3v6pie96bma5k8pzbvbdpu8dchyn46nw"); + assertInvalidAddress("ndx1x97gyubjrkqbu4a5m3kpxyz4qhap3c3ui7359pzskwv4"); + assertInvalidAddress("ndbjhklcvj88beqcamr439z6d6icm5mjwth5r7vrgfbnxktr"); + assertInvalidAddress("ndmpdkab97bi4ea73scjh6xpt8njjjhhaArarpr2zzzrv88u"); + } +} From c8cb7fff1e76b9de9f70a14b7fc0e05982c0b67e Mon Sep 17 00:00:00 2001 From: Devin Bileck <603793+devinbileck@users.noreply.github.com> Date: Sun, 2 Jun 2019 23:52:11 -0700 Subject: [PATCH 24/27] Show connected Bitcoin network peer info --- .../bisq/core/btc/setup/WalletsSetup.java | 18 +++ .../resources/i18n/displayStrings.properties | 4 + .../network/BitcoinNetworkListItem.java | 44 +++++++ .../settings/network/NetworkSettingsView.fxml | 37 ++++-- .../settings/network/NetworkSettingsView.java | 108 +++++++++++------- 5 files changed, 164 insertions(+), 47 deletions(-) create mode 100644 desktop/src/main/java/bisq/desktop/main/settings/network/BitcoinNetworkListItem.java diff --git a/core/src/main/java/bisq/core/btc/setup/WalletsSetup.java b/core/src/main/java/bisq/core/btc/setup/WalletsSetup.java index 14dd75236ac..773fe88d72b 100644 --- a/core/src/main/java/bisq/core/btc/setup/WalletsSetup.java +++ b/core/src/main/java/bisq/core/btc/setup/WalletsSetup.java @@ -122,6 +122,8 @@ public class WalletsSetup { private final File walletDir; private final int socks5DiscoverMode; private final IntegerProperty numPeers = new SimpleIntegerProperty(0); + private final IntegerProperty chainHeight = new SimpleIntegerProperty(0); + private final ObjectProperty blocksDownloadedFromPeer = new SimpleObjectProperty<>(); private final ObjectProperty> connectedPeers = new SimpleObjectProperty<>(); private final DownloadListener downloadListener = new DownloadListener(); private final List setupCompletedHandlers = new ArrayList<>(); @@ -200,6 +202,7 @@ protected void onSetupCompleted() { super.onSetupCompleted(); final PeerGroup peerGroup = walletConfig.peerGroup(); + final BlockChain chain = walletConfig.chain(); // We don't want to get our node white list polluted with nodes from AddressMessage calls. if (preferences.getBitcoinNodes() != null && !preferences.getBitcoinNodes().isEmpty()) @@ -215,6 +218,13 @@ protected void onSetupCompleted() { numPeers.set(peerCount); connectedPeers.set(peerGroup.getConnectedPeers()); }); + peerGroup.addBlocksDownloadedEventListener((peer, block, filteredBlock, blocksLeft) -> { + blocksDownloadedFromPeer.set(peer); + }); + chain.addNewBestBlockListener(block -> { + connectedPeers.set(peerGroup.getConnectedPeers()); + chainHeight.set(block.getHeight()); + }); // Map to user thread UserThread.execute(() -> { @@ -429,6 +439,14 @@ public ReadOnlyObjectProperty> connectedPeersProperty() { return connectedPeers; } + public ReadOnlyIntegerProperty chainHeightProperty() { + return chainHeight; + } + + public ReadOnlyObjectProperty blocksDownloadedFromPeerProperty() { + return blocksDownloadedFromPeer; + } + public ReadOnlyDoubleProperty downloadPercentageProperty() { return downloadListener.percentageProperty(); } diff --git a/core/src/main/resources/i18n/displayStrings.properties b/core/src/main/resources/i18n/displayStrings.properties index 2173fe5a929..00a85fc556f 100644 --- a/core/src/main/resources/i18n/displayStrings.properties +++ b/core/src/main/resources/i18n/displayStrings.properties @@ -1060,6 +1060,10 @@ settings.net.receivedBytesColumn=Received settings.net.peerTypeColumn=Peer type settings.net.openTorSettingsButton=Open Tor settings +settings.net.versionColumn=Version +settings.net.subVersionColumn=Subversion +settings.net.heightColumn=Height + settings.net.needRestart=You need to restart the application to apply that change.\nDo you want to do that now? settings.net.notKnownYet=Not known yet... settings.net.sentReceived=Sent: {0}, received: {1} diff --git a/desktop/src/main/java/bisq/desktop/main/settings/network/BitcoinNetworkListItem.java b/desktop/src/main/java/bisq/desktop/main/settings/network/BitcoinNetworkListItem.java new file mode 100644 index 00000000000..a3a2aa05e77 --- /dev/null +++ b/desktop/src/main/java/bisq/desktop/main/settings/network/BitcoinNetworkListItem.java @@ -0,0 +1,44 @@ +/* + * 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.desktop.main.settings.network; + +import org.bitcoinj.core.Peer; + +public class BitcoinNetworkListItem { + private final Peer peer; + + public BitcoinNetworkListItem(Peer peer) { + this.peer = peer; + } + + public String getOnionAddress() { + return peer.getAddress().toString(); + } + + public String getVersion() { + return String.valueOf(peer.getPeerVersionMessage().clientVersion); + } + + public String getSubVersion() { + return peer.getPeerVersionMessage().subVer; + } + + public String getHeight() { + return String.valueOf(peer.getBestHeight()); + } +} diff --git a/desktop/src/main/java/bisq/desktop/main/settings/network/NetworkSettingsView.fxml b/desktop/src/main/java/bisq/desktop/main/settings/network/NetworkSettingsView.fxml index 7cada589b6b..d583b18a099 100644 --- a/desktop/src/main/java/bisq/desktop/main/settings/network/NetworkSettingsView.fxml +++ b/desktop/src/main/java/bisq/desktop/main/settings/network/NetworkSettingsView.fxml @@ -21,7 +21,6 @@ - @@ -45,12 +44,34 @@ - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -91,7 +112,7 @@ - + diff --git a/desktop/src/main/java/bisq/desktop/main/settings/network/NetworkSettingsView.java b/desktop/src/main/java/bisq/desktop/main/settings/network/NetworkSettingsView.java index a39911d442c..b7c3c6fa085 100644 --- a/desktop/src/main/java/bisq/desktop/main/settings/network/NetworkSettingsView.java +++ b/desktop/src/main/java/bisq/desktop/main/settings/network/NetworkSettingsView.java @@ -44,8 +44,6 @@ import bisq.common.ClockWatcher; import bisq.common.UserThread; -import org.bitcoinj.core.Peer; - import javax.inject.Inject; import javafx.fxml.FXML; @@ -55,7 +53,6 @@ import javafx.scene.control.RadioButton; import javafx.scene.control.TableColumn; import javafx.scene.control.TableView; -import javafx.scene.control.TextArea; import javafx.scene.control.TextField; import javafx.scene.control.Toggle; import javafx.scene.control.ToggleGroup; @@ -73,7 +70,6 @@ import javafx.collections.ObservableList; import javafx.collections.transformation.SortedList; -import java.util.List; import java.util.concurrent.TimeUnit; import java.util.stream.Collectors; @@ -83,25 +79,28 @@ public class NetworkSettingsView extends ActivatableViewAndModel tableView; + TableView p2pPeersTableView; + @FXML + TableView bitcoinPeersTableView; @FXML TableColumn onionAddressColumn, connectionTypeColumn, creationDateColumn, roundTripTimeColumn, sentBytesColumn, receivedBytesColumn, peerTypeColumn; @FXML + TableColumn bitcoinPeerAddressColumn, bitcoinPeerVersionColumn, + bitcoinPeerSubVersionColumn, bitcoinPeerHeightColumn; + @FXML Label reSyncSPVChainLabel; @FXML AutoTooltipButton reSyncSPVChainButton, openTorSettingsButton; @@ -116,11 +115,16 @@ public class NetworkSettingsView extends ActivatableViewAndModel networkListItems = FXCollections.observableArrayList(); - private final SortedList sortedList = new SortedList<>(networkListItems); + private final ObservableList p2pNetworkListItems = FXCollections.observableArrayList(); + private final SortedList p2pSortedList = new SortedList<>(p2pNetworkListItems); + + private final ObservableList bitcoinNetworkListItems = FXCollections.observableArrayList(); + private final SortedList bitcoinSortedList = new SortedList<>(bitcoinNetworkListItems); private Subscription numP2PPeersSubscription; private Subscription bitcoinPeersSubscription; + private Subscription bitcoinBlockHeightSubscription; + private Subscription bitcoinBlocksDownloadedSubscription; private Subscription nodeAddressSubscription; private ChangeListener btcNodesInputTextFieldFocusListener; private ToggleGroup bitcoinPeersToggleGroup; @@ -156,9 +160,18 @@ public void initialize() { p2pHeader.setText(Res.get("settings.net.p2pHeader")); onionAddress.setPromptText(Res.get("settings.net.onionAddressLabel")); btcNodesLabel.setText(Res.get("settings.net.btcNodesLabel")); - bitcoinPeersTextArea.setPromptText(Res.get("settings.net.bitcoinPeersLabel")); + bitcoinPeersLabel.setText(Res.get("settings.net.bitcoinPeersLabel")); useTorForBtcJCheckBox.setText(Res.get("settings.net.useTorForBtcJLabel")); bitcoinNodesLabel.setText(Res.get("settings.net.bitcoinNodesLabel")); + bitcoinPeerAddressColumn.setGraphic(new AutoTooltipLabel(Res.get("settings.net.onionAddressColumn"))); + bitcoinPeerAddressColumn.getStyleClass().add("first-column"); + bitcoinPeerVersionColumn.setGraphic(new AutoTooltipLabel(Res.get("settings.net.versionColumn"))); + bitcoinPeerSubVersionColumn.setGraphic(new AutoTooltipLabel(Res.get("settings.net.subVersionColumn"))); + bitcoinPeerHeightColumn.setGraphic(new AutoTooltipLabel(Res.get("settings.net.heightColumn"))); + localhostBtcNodeInfoLabel.setText(Res.get("settings.net.localhostBtcNodeInfo")); + if (!bisqEnvironment.isBitcoinLocalhostNodeRunning()) { + localhostBtcNodeInfoLabel.setVisible(false); + } useProvidedNodesRadio.setText(Res.get("settings.net.useProvidedNodesRadio")); useCustomNodesRadio.setText(Res.get("settings.net.useCustomNodesRadio")); usePublicNodesRadio.setText(Res.get("settings.net.usePublicNodesRadio")); @@ -177,16 +190,25 @@ public void initialize() { peerTypeColumn.getStyleClass().add("last-column"); openTorSettingsButton.updateText(Res.get("settings.net.openTorSettingsButton")); + GridPane.setMargin(bitcoinPeersLabel, new Insets(4, 0, 0, 0)); + GridPane.setValignment(bitcoinPeersLabel, VPos.TOP); + GridPane.setMargin(p2PPeersLabel, new Insets(4, 0, 0, 0)); GridPane.setValignment(p2PPeersLabel, VPos.TOP); - bitcoinPeersTextArea.setPrefRowCount(4); + bitcoinPeersTableView.setMinHeight(180); + bitcoinPeersTableView.setPrefHeight(180); + bitcoinPeersTableView.setColumnResizePolicy(TableView.CONSTRAINED_RESIZE_POLICY); + bitcoinPeersTableView.setPlaceholder(new AutoTooltipLabel(Res.get("table.placeholder.noData"))); + bitcoinPeersTableView.getSortOrder().add(bitcoinPeerAddressColumn); + bitcoinPeerAddressColumn.setSortType(TableColumn.SortType.ASCENDING); + - tableView.setMinHeight(180); - tableView.setPrefHeight(180); - tableView.setColumnResizePolicy(TableView.CONSTRAINED_RESIZE_POLICY); - tableView.setPlaceholder(new AutoTooltipLabel(Res.get("table.placeholder.noData"))); - tableView.getSortOrder().add(creationDateColumn); + p2pPeersTableView.setMinHeight(180); + p2pPeersTableView.setPrefHeight(180); + p2pPeersTableView.setColumnResizePolicy(TableView.CONSTRAINED_RESIZE_POLICY); + p2pPeersTableView.setPlaceholder(new AutoTooltipLabel(Res.get("table.placeholder.noData"))); + p2pPeersTableView.getSortOrder().add(creationDateColumn); creationDateColumn.setSortType(TableColumn.SortType.ASCENDING); bitcoinPeersToggleGroup = new ToggleGroup(); @@ -267,7 +289,13 @@ public void activate() { reSyncSPVChainButton.setOnAction(event -> GUIUtil.reSyncSPVChain(walletsSetup, preferences)); bitcoinPeersSubscription = EasyBind.subscribe(walletsSetup.connectedPeersProperty(), - connectedPeers -> updateBitcoinPeersTextArea()); + connectedPeers -> updateBitcoinPeersTable()); + + bitcoinBlocksDownloadedSubscription = EasyBind.subscribe(walletsSetup.blocksDownloadedFromPeerProperty(), + peer -> updateBitcoinPeersTable()); + + bitcoinBlockHeightSubscription = EasyBind.subscribe(walletsSetup.chainHeightProperty(), + chainHeight -> updateBitcoinPeersTable()); nodeAddressSubscription = EasyBind.subscribe(p2PService.getNetworkNode().nodeAddressProperty(), nodeAddress -> onionAddress.setText(nodeAddress == null ? @@ -280,8 +308,11 @@ public void activate() { BSFormatter.formatBytes((long) sent), BSFormatter.formatBytes((long) received)))); - sortedList.comparatorProperty().bind(tableView.comparatorProperty()); - tableView.setItems(sortedList); + bitcoinSortedList.comparatorProperty().bind(bitcoinPeersTableView.comparatorProperty()); + bitcoinPeersTableView.setItems(bitcoinSortedList); + + p2pSortedList.comparatorProperty().bind(p2pPeersTableView.comparatorProperty()); + p2pPeersTableView.setItems(p2pSortedList); btcNodesInputTextField.setText(preferences.getBitcoinNodes()); btcNodesInputTextField.setPromptText(Res.get("settings.net.ips")); @@ -305,13 +336,20 @@ public void deactivate() { if (bitcoinPeersSubscription != null) bitcoinPeersSubscription.unsubscribe(); + if (bitcoinBlockHeightSubscription != null) + bitcoinBlockHeightSubscription.unsubscribe(); + + if (bitcoinBlocksDownloadedSubscription != null) + bitcoinBlocksDownloadedSubscription.unsubscribe(); + if (numP2PPeersSubscription != null) numP2PPeersSubscription.unsubscribe(); totalTrafficTextField.textProperty().unbind(); - sortedList.comparatorProperty().unbind(); - tableView.getItems().forEach(P2pNetworkListItem::cleanup); + bitcoinSortedList.comparatorProperty().unbind(); + p2pSortedList.comparatorProperty().unbind(); + p2pPeersTableView.getItems().forEach(P2pNetworkListItem::cleanup); btcNodesInputTextField.focusedProperty().removeListener(btcNodesInputTextFieldFocusListener); btcNodesInputTextField.textProperty().removeListener(btcNodesInputTextFieldListener); @@ -422,26 +460,18 @@ private void applyPreventPublicBtcNetwork() { } private void updateP2PTable() { - tableView.getItems().forEach(P2pNetworkListItem::cleanup); - networkListItems.clear(); - networkListItems.setAll(p2PService.getNetworkNode().getAllConnections().stream() + p2pPeersTableView.getItems().forEach(P2pNetworkListItem::cleanup); + p2pNetworkListItems.clear(); + p2pNetworkListItems.setAll(p2PService.getNetworkNode().getAllConnections().stream() .map(connection -> new P2pNetworkListItem(connection, clockWatcher, formatter)) .collect(Collectors.toList())); } - private void updateBitcoinPeersTextArea() { - bitcoinPeersTextArea.clear(); - List peerList = walletsSetup.connectedPeersProperty().get(); - if (peerList != null) { - peerList.stream().forEach(e -> { - if (bitcoinPeersTextArea.getText().length() > 0) - bitcoinPeersTextArea.appendText("\n"); - bitcoinPeersTextArea.appendText(e.toString()); - }); - } - - if (bisqEnvironment.isBitcoinLocalhostNodeRunning()) - bitcoinPeersTextArea.appendText("\n\n" + Res.get("settings.net.localhostBtcNodeInfo")); + private void updateBitcoinPeersTable() { + bitcoinNetworkListItems.clear(); + bitcoinNetworkListItems.setAll(walletsSetup.getPeerGroup().getConnectedPeers().stream() + .map(BitcoinNetworkListItem::new) + .collect(Collectors.toList())); } } From 4eb3b594b22e189161b8c7473968f5284b1a0440 Mon Sep 17 00:00:00 2001 From: Christoph Atteneder Date: Fri, 18 Oct 2019 11:46:29 +0200 Subject: [PATCH 25/27] Not show payment account details for blocked offers (#3425) --- .../desktop/main/offer/offerbook/OfferBookView.java | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/desktop/src/main/java/bisq/desktop/main/offer/offerbook/OfferBookView.java b/desktop/src/main/java/bisq/desktop/main/offer/offerbook/OfferBookView.java index 26eb7e603b7..36eeec108a0 100644 --- a/desktop/src/main/java/bisq/desktop/main/offer/offerbook/OfferBookView.java +++ b/desktop/src/main/java/bisq/desktop/main/offer/offerbook/OfferBookView.java @@ -882,10 +882,15 @@ public void updateItem(final OfferBookListItem item, boolean empty) { super.updateItem(item, empty); if (item != null && !empty) { - field = new HyperlinkWithIcon(model.getPaymentMethod(item)); - field.setOnAction(event -> offerDetailsWindow.show(item.getOffer())); - field.setTooltip(new Tooltip(model.getPaymentMethodToolTip(item))); - setGraphic(field); + + if (model.isOfferBanned(item.getOffer())) { + setGraphic(new AutoTooltipLabel(model.getPaymentMethod(item))); + } else { + field = new HyperlinkWithIcon(model.getPaymentMethod(item)); + field.setOnAction(event -> offerDetailsWindow.show(item.getOffer())); + field.setTooltip(new Tooltip(model.getPaymentMethodToolTip(item))); + setGraphic(field); + } } else { setGraphic(null); if (field != null) From 2967702db1ded2b3c782f70876976b9cfad2915d Mon Sep 17 00:00:00 2001 From: wiz Date: Thu, 24 Oct 2019 22:25:17 +0900 Subject: [PATCH 26/27] Add GitHub issue template for user reported bugs (#3454) * Add issue template with steps to reproduce and actual/expected behavior * Fix typo in .github/ISSUE_TEMPLATE.md --- .github/ISSUE_TEMPLATE.md | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 .github/ISSUE_TEMPLATE.md diff --git a/.github/ISSUE_TEMPLATE.md b/.github/ISSUE_TEMPLATE.md new file mode 100644 index 00000000000..c6858a9c084 --- /dev/null +++ b/.github/ISSUE_TEMPLATE.md @@ -0,0 +1,33 @@ +### Description + + + +#### Version + + + +### Steps to reproduce + + + +### Expected behaviour + + + +### Actual behaviour + + + +### Screenshots + + + +#### Device or machine + + + + + +#### Additional info + + From 2a28e12a675d74e4455807f51aa658dd96251ec0 Mon Sep 17 00:00:00 2001 From: Christoph Atteneder Date: Wed, 30 Oct 2019 17:01:31 +0100 Subject: [PATCH 27/27] Fix wrong auto merge --- .../trade/protocol/tasks/PublishTradeStatistics.java | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/core/src/main/java/bisq/core/trade/protocol/tasks/PublishTradeStatistics.java b/core/src/main/java/bisq/core/trade/protocol/tasks/PublishTradeStatistics.java index d7ad2b9ef03..ab083218d27 100644 --- a/core/src/main/java/bisq/core/trade/protocol/tasks/PublishTradeStatistics.java +++ b/core/src/main/java/bisq/core/trade/protocol/tasks/PublishTradeStatistics.java @@ -63,18 +63,6 @@ protected void run() { extraDataMap.put(TradeStatistics2.MEDIATOR_ADDRESS, address); } - NodeAddress mediatorNodeAddress = trade.getMediatorNodeAddress(); - if (mediatorNodeAddress != null) { - // The first 4 chars are sufficient to identify an arbitrator. - // For testing with regtest/localhost we use the full address as its localhost and would result in - // same values for multiple arbitrators. - NetworkNode networkNode = model.getProcessModel().getP2PService().getNetworkNode(); - String address = networkNode instanceof TorNetworkNode ? - mediatorNodeAddress.getFullAddress().substring(0, 4) : - mediatorNodeAddress.getFullAddress(); - extraDataMap.put(TradeStatistics2.MEDIATOR_ADDRESS, address); - } - Offer offer = trade.getOffer(); checkNotNull(offer, "offer must not ne null"); checkNotNull(trade.getTradeAmount(), "trade.getTradeAmount() must not ne null");