From ac30a49467e3d929f88ea1de8cde3bd89c138221 Mon Sep 17 00:00:00 2001 From: Oscar Guindzberg Date: Tue, 16 Apr 2019 14:59:56 -0300 Subject: [PATCH 01/30] Remove bcprov-jdk15on dependency, already included by bcpg-jdk15on --- build.gradle | 1 - 1 file changed, 1 deletion(-) diff --git a/build.gradle b/build.gradle index 976fe88f050..c81b42026c5 100644 --- a/build.gradle +++ b/build.gradle @@ -182,7 +182,6 @@ configure(project(':common')) { exclude(module: 'protobuf-java') } compile 'org.jetbrains:annotations:13.0' - runtime "org.bouncycastle:bcprov-jdk15on:$bcVersion" compile "org.bouncycastle:bcpg-jdk15on:$bcVersion" compile 'commons-io:commons-io:2.4' compile "org.apache.commons:commons-lang3:$langVersion" From 8456d3daf6f6932c245ff8d172d9f2112975d328 Mon Sep 17 00:00:00 2001 From: Oscar Guindzberg Date: Mon, 22 Apr 2019 15:14:10 -0300 Subject: [PATCH 02/30] Use bitcoinj 0.15.1 (commit 40c9898) --- build.gradle | 6 +++--- gradle/witness/gradle-witness.gradle | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/build.gradle b/build.gradle index c81b42026c5..1169917535f 100644 --- a/build.gradle +++ b/build.gradle @@ -33,7 +33,7 @@ configure(subprojects) { jmockitVersion = '1.42' joptVersion = '5.0.3' langVersion = '3.4' - bitcoinjVersion = 'a88d36d' + bitcoinjVersion = '40c9898' logbackVersion = '1.1.10' lombokVersion = '1.18.2' mockitoVersion = '2.21.0' @@ -132,7 +132,7 @@ configure([project(':desktop'), configure(project(':assets')) { dependencies { - compile("com.github.bisq-network.bitcoinj:bitcoinj-core:$bitcoinjVersion") { + compile("com.github.bisq-network:bitcoinj:$bitcoinjVersion") { exclude(module: 'jsr305') exclude(module: 'slf4j-api') exclude(module: 'guava') @@ -175,7 +175,7 @@ configure(project(':common')) { compile('com.google.inject:guice:4.1.0') { exclude(module: 'guava') } - compile("com.github.bisq-network.bitcoinj:bitcoinj-core:$bitcoinjVersion") { + compile("com.github.bisq-network:bitcoinj:$bitcoinjVersion") { exclude(module: 'jsr305') exclude(module: 'slf4j-api') exclude(module: 'guava') diff --git a/gradle/witness/gradle-witness.gradle b/gradle/witness/gradle-witness.gradle index 29746adde8b..b7f50d85ae6 100644 --- a/gradle/witness/gradle-witness.gradle +++ b/gradle/witness/gradle-witness.gradle @@ -43,7 +43,7 @@ dependencyVerification { 'com.google.code.findbugs:jsr305:766ad2a0783f2687962c8ad74ceecc38a28b9f72a2d085ee438b7813e928d0c7', 'com.google.guava:guava:36a666e3b71ae7f0f0dca23654b67e086e6c93d192f60ba5dfd5519db6c288c8', 'com.google.inject:guice:9b9df27a5b8c7864112b4137fd92b36c3f1395bfe57be42fedf2f520ead1a93e', - 'com.github.bisq-network.bitcoinj:bitcoinj-core:f979c2187e61ee3b08dd4cbfc49a149734cff64c045d29ed112f2e12f34068a3', + 'com.github.bisq-network:bitcoinj:47dd30f2872ee7dd57efc6247a3cc4b40e7c43892ad1b960d46e1f883324792d', 'com.github.JesusMcCloud.netlayer:tor:35cf892e6ce3a8d942cfd2b589cfbde5aed31d49777aee873d6614e134df0b42', 'org.jetbrains.kotlin:kotlin-stdlib-jdk8:193ab7813e4d249f2ea4fc1b968fea8c2126bcbeeb5d6127050ce1b93dbaa7c2', 'io.github.microutils:kotlin-logging:4992504fd3c6ecdf9ed10874b9508e758bb908af9e9d7af19a61e9afb6b7e27a', From 77d7468c2867fd96ff396b90df0aa0bc72a4211a Mon Sep 17 00:00:00 2001 From: Oscar Guindzberg Date: Tue, 16 Apr 2019 15:17:38 -0300 Subject: [PATCH 03/30] bitcoinj 0.15: Update depencencies to match bitcoinj versions --- build.gradle | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/build.gradle b/build.gradle index 1169917535f..fc66de36201 100644 --- a/build.gradle +++ b/build.gradle @@ -27,7 +27,7 @@ configure(subprojects) { sourceCompatibility = 1.10 ext { - bcVersion = '1.56' + bcVersion = '1.60' codecVersion = '1.9' easyVersion = '4.0.1' jmockitVersion = '1.42' @@ -38,8 +38,8 @@ configure(subprojects) { lombokVersion = '1.18.2' mockitoVersion = '2.21.0' powermockVersion = '2.0.0-beta.5' - protobufVersion = '3.5.1' - slf4jVersion = '1.7.22' + protobufVersion = '3.6.1' + slf4jVersion = '1.7.25' sparkVersion = '2.5.2' springVersion = '4.3.6.RELEASE' @@ -138,7 +138,7 @@ configure(project(':assets')) { exclude(module: 'guava') exclude(module: 'protobuf-java') } - compile 'com.google.guava:guava:20.0' + compile 'com.google.guava:guava:27.0.1-jre' compile "org.slf4j:slf4j-api:$slf4jVersion" compile "commons-codec:commons-codec:$codecVersion" compile "org.apache.commons:commons-lang3:$langVersion" @@ -171,7 +171,7 @@ configure(project(':common')) { compile "ch.qos.logback:logback-core:$logbackVersion" compile "ch.qos.logback:logback-classic:$logbackVersion" compile 'com.google.code.findbugs:jsr305:3.0.2' - compile 'com.google.guava:guava:20.0' + compile 'com.google.guava:guava:27.0.1-jre' compile('com.google.inject:guice:4.1.0') { exclude(module: 'guava') } @@ -338,7 +338,7 @@ configure(project(':monitor')) { compile "org.slf4j:slf4j-api:$slf4jVersion" compile "ch.qos.logback:logback-core:$logbackVersion" compile "ch.qos.logback:logback-classic:$logbackVersion" - compile 'com.google.guava:guava:20.0' + compile 'com.google.guava:guava:27.0.1-jre' compileOnly "org.projectlombok:lombok:$lombokVersion" annotationProcessor "org.projectlombok:lombok:$lombokVersion" From 3c4b305a3e1eacac75a899b16d47df301ca70338 Mon Sep 17 00:00:00 2001 From: Oscar Guindzberg Date: Tue, 9 Apr 2019 12:01:47 -0300 Subject: [PATCH 04/30] bitcoinj 0.15: bitcoinj exclude dependency bcprov-jdk15on because already included by bisq. --- build.gradle | 2 ++ 1 file changed, 2 insertions(+) diff --git a/build.gradle b/build.gradle index fc66de36201..b57a49a3172 100644 --- a/build.gradle +++ b/build.gradle @@ -137,6 +137,7 @@ configure(project(':assets')) { exclude(module: 'slf4j-api') exclude(module: 'guava') exclude(module: 'protobuf-java') + exclude(module: 'bcprov-jdk15on') } compile 'com.google.guava:guava:27.0.1-jre' compile "org.slf4j:slf4j-api:$slf4jVersion" @@ -180,6 +181,7 @@ configure(project(':common')) { exclude(module: 'slf4j-api') exclude(module: 'guava') exclude(module: 'protobuf-java') + exclude(module: 'bcprov-jdk15on') } compile 'org.jetbrains:annotations:13.0' compile "org.bouncycastle:bcpg-jdk15on:$bcVersion" From 3b919376f395fa12e9632acfb40b34de8b68fd1d Mon Sep 17 00:00:00 2001 From: Oscar Guindzberg Date: Tue, 16 Apr 2019 18:10:14 -0300 Subject: [PATCH 05/30] bitcoinj 0.15: Update modified dependencies hashes. --- gradle/witness/gradle-witness.gradle | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/gradle/witness/gradle-witness.gradle b/gradle/witness/gradle-witness.gradle index b7f50d85ae6..925bf78a710 100644 --- a/gradle/witness/gradle-witness.gradle +++ b/gradle/witness/gradle-witness.gradle @@ -33,15 +33,15 @@ dependencyVerification { 'com.fasterxml.jackson.core:jackson-databind:fcf3c2b0c332f5f54604f7e27fa7ee502378a2cc5df6a944bbfae391872c32ff', 'com.fasterxml.jackson.core:jackson-core:39a74610521d7fb9eb3f437bb8739bbf47f6435be12d17bf954c731a0c6352bb', 'com.fasterxml.jackson.core:jackson-annotations:2566b3a6662afa3c6af4f5b25006cb46be2efc68f1b5116291d6998a8cdf7ed3', - 'com.google.protobuf:protobuf-java:b5e2d91812d183c9f053ffeebcbcda034d4de6679521940a19064714966c2cd4', + 'com.google.protobuf:protobuf-java:fb66d913ff0578553b2e28a3338cbbbe2657e6cfe0e98d939f23aea219daf508', 'com.google.code.gson:gson:2d43eb5ea9e133d2ee2405cc14f5ee08951b8361302fdd93494a3a997b508d32', 'com.googlecode.json-simple:json-simple:4e69696892b88b41c55d49ab2fdcc21eead92bf54acc588c0050596c3b75199c', 'org.springframework:spring-core:c451e8417adb2ffb2445636da5e44a2f59307c4100037a1fe387c3fba4f29b52', 'ch.qos.logback:logback-classic:e66efc674e94837344bc5b748ff510c37a44eeff86cbfdbf9e714ef2eb374013', - 'org.slf4j:slf4j-api:3a4cd4969015f3beb4b5b4d81dbafc01765fb60b8a439955ca64d8476fef553e', + 'org.slf4j:slf4j-api:18c4a0095d5c1da6b817592e767bb23d29dd2f560ad74df75ff3961dbde25b79', 'ch.qos.logback:logback-core:4cd46fa17d77057b39160058df2f21ebbc2aded51d0edcc25d2c1cecc042a005', 'com.google.code.findbugs:jsr305:766ad2a0783f2687962c8ad74ceecc38a28b9f72a2d085ee438b7813e928d0c7', - 'com.google.guava:guava:36a666e3b71ae7f0f0dca23654b67e086e6c93d192f60ba5dfd5519db6c288c8', + 'com.google.guava:guava:e1c814fd04492a27c38e0317eabeaa1b3e950ec8010239e400fe90ad6c9107b4', 'com.google.inject:guice:9b9df27a5b8c7864112b4137fd92b36c3f1395bfe57be42fedf2f520ead1a93e', 'com.github.bisq-network:bitcoinj:47dd30f2872ee7dd57efc6247a3cc4b40e7c43892ad1b960d46e1f883324792d', 'com.github.JesusMcCloud.netlayer:tor:35cf892e6ce3a8d942cfd2b589cfbde5aed31d49777aee873d6614e134df0b42', @@ -50,10 +50,10 @@ dependencyVerification { 'org.jetbrains.kotlin:kotlin-stdlib-jdk7:877b59bbe466b24a88275a71fd06cd97359d2085420f6f1ac1d766afa8116001', 'org.jetbrains.kotlin:kotlin-stdlib:4ff0fcb97f4983b4aaba12668c24ad21b08460915db1b021d8f1d8bee687f21c', 'org.jetbrains:annotations:ace2a10dc8e2d5fd34925ecac03e4988b2c0f851650c94b8cef49ba1bd111478', - 'org.bouncycastle:bcpg-jdk15on:de3355b821fc81dd32e1f3f560d5b3eca1c678fd2400011d0bfc69fb91bcde85', + 'org.bouncycastle:bcpg-jdk15on:81bd663e48d0a10d9553ff45bb058079835db56c7115248399e129a2ee836a07', 'commons-io:commons-io:cc6a41dc3eaacc9e440a6bd0d2890b20d36b4ee408fe2d67122f328bb6e01581', 'org.apache.commons:commons-lang3:734c8356420cc8e30c795d64fd1fcd5d44ea9d90342a2cc3262c5158fbc6d98b', - 'org.bouncycastle:bcprov-jdk15on:963e1ee14f808ffb99897d848ddcdb28fa91ddda867eb18d303e82728f878349', + 'org.bouncycastle:bcprov-jdk15on:7f1a0e6badab38666f8467a9a0ee96656b2f8ec8623867ed34f3cdc173b7ee07', 'com.google.zxing:javase:0ec23e2ec12664ddd6347c8920ad647bb3b9da290f897a88516014b56cc77eb9', 'com.nativelibs4java:bridj:101bcd9b6637e6bc16e56deb3daefba62b1f5e8e9e37e1b3e56e3b5860d659cf', 'com.github.JesusMcCloud.tor-binary:tor-binary-macos:18f7f1a567821dcc22c4b2146db8c4d00a5c6945a556f1a60085b06ad6d61054', @@ -64,19 +64,23 @@ dependencyVerification { 'org.apache.httpcomponents:httpcore:d7f853dee87680b07293d30855b39b9eb56c1297bd16ff1cd6f19ddb8fa745fb', 'commons-codec:commons-codec:ad19d2601c3abf0b946b5c3a4113e226a8c1e3305e395b90013b78dd94a723ce', 'commons-logging:commons-logging:daddea1ea0be0f56978ab3006b8ac92834afeefbd9b7e4e6316fca57df0fa636', + 'com.google.guava:failureaccess:a171ee4c734dd2da837e4b16be9df4661afab72a41adaf31eb84dfdaf936ca26', + 'com.google.guava:listenablefuture:b372a037d4230aa57fbeffdef30fd6123f9c0c2db85d0aced00c91b974f33f99', + 'org.checkerframework:checker-qual:64b02691c8b9d4e7700f8ee2e742dce7ea2c6e81e662b7522c9ee3bf568c040a', + 'com.google.errorprone:error_prone_annotations:6ebd22ca1b9d8ec06d41de8d64e0596981d9607b42035f9ed374f9de271a481a', + 'com.google.j2objc:j2objc-annotations:2994a7eb78f2710bd3d3bfb639b2c94e219cedac0d4d084d516e78c16dddecf6', + 'org.codehaus.mojo:animal-sniffer-annotations:92654f493ecfec52082e76354f0ebf87648dc3d5cec2e3c3cdb947c016747a53', 'javax.inject:javax.inject:91c77044a50c481636c32d916fd89c9118a72195390452c81065080f957de7ff', 'aopalliance:aopalliance:0addec670fedcd3f113c5c8091d783280d23f75e3acb841b61a9cdb079376a08', - 'com.madgag.spongycastle:core:8d6240b974b0aca4d3da9c7dd44d42339d8a374358aca5fc98e50a995764511f', 'net.jcip:jcip-annotations:be5805392060c71474bf6c9a67a099471274d30b83eef84bfc4e0889a4f1dcc0', 'com.lambdaworks:scrypt:9a82d218099fb14c10c0e86e7eefeebd8c104de920acdc47b8b4b7a686fb73b4', - 'org.bitcoinj:orchid:f836325cfa0466a011cb755c9b0fee6368487a2352eb45f4306ad9e4c18de080', - 'com.squareup.okhttp:okhttp:b4c943138fcef2bcc9d2006b2250c4aabbedeafc5947ed7c0af7fd103ceb2707', + 'com.squareup.okhttp3:okhttp:07c3d82ca7eaf4722f00b2da807dc7860f6169ae60cfedcf5d40218f90880a46', 'com.google.zxing:core:11aae8fd974ab25faa8208be50468eb12349cd239e93e7c797377fa13e381729', 'com.github.JesusMcCloud.tor-binary:tor-binary-geoip:766e4400e5651cf0b11788ea440cc72721be9b92e42f20809c22d0ff129df83c', 'com.github.JesusMcCloud:jtorctl:904f7c53332179a3479c64d63fb303afa6a02b6889aabdab5b235f3efc725ca7', 'org.apache.commons:commons-compress:5f2df1e467825e4cac5996d44890c4201c000b43c0b23cffc0782d28a0beb9b0', 'org.tukaani:xz:a594643d73cc01928cf6ca5ce100e094ea9d73af760a5d4fb6b75fa673ecec96', - 'com.squareup.okio:okio:114bdc1f47338a68bcbc95abf2f5cdc72beeec91812f2fcd7b521c1937876266', + 'com.squareup.okio:okio:693fa319a7e8843300602b204023b7674f106ebcb577f2dd5807212b66118bd2', 'org.jetbrains.kotlin:kotlin-stdlib-common:4b161ef619eee0d1a49b1c4f0c4a8e46f4e342573efd8e0106a765f47475fe39', ] } From 56ff42ad1dca072ab210050deae064e25feb41cd Mon Sep 17 00:00:00 2001 From: Oscar Guindzberg Date: Tue, 16 Apr 2019 16:13:49 -0300 Subject: [PATCH 06/30] bitcoinj 0.15: Futures.addCallback() in guava 27 requires an executor. Using MoreExecutors.directExecutor() as it used to be the default behaviour with the executor-less method. --- .../main/java/bisq/core/btc/wallet/BtcWalletService.java | 7 ++++--- core/src/main/java/bisq/core/btc/wallet/TxBroadcaster.java | 3 ++- core/src/main/java/bisq/core/btc/wallet/WalletService.java | 3 ++- .../blindvote/network/RepublishGovernanceDataHandler.java | 3 ++- .../dao/monitoring/network/RequestStateHashesHandler.java | 3 ++- .../core/dao/node/explorer/ExportJsonFilesService.java | 3 ++- core/src/main/java/bisq/core/dao/node/full/RpcService.java | 7 ++++--- .../dao/node/full/network/GetBlocksRequestHandler.java | 3 ++- .../core/dao/node/lite/network/RequestBlocksHandler.java | 3 ++- .../bisq/core/notifications/MobileNotificationService.java | 3 ++- core/src/main/java/bisq/core/provider/fee/FeeRequest.java | 3 ++- core/src/main/java/bisq/core/provider/fee/FeeService.java | 3 ++- .../java/bisq/core/provider/price/PriceFeedService.java | 3 ++- .../main/java/bisq/core/provider/price/PriceRequest.java | 3 ++- core/src/main/java/bisq/core/trade/Trade.java | 3 ++- .../bisq/desktop/main/offer/MutableOfferDataModel.java | 2 +- .../desktop/main/offer/takeoffer/TakeOfferDataModel.java | 2 +- .../main/java/bisq/monitor/metric/P2PRoundTripTime.java | 3 ++- .../main/java/bisq/monitor/metric/P2PSeedNodeSnapshot.java | 3 ++- p2p/src/main/java/bisq/network/p2p/P2PService.java | 5 +++-- .../main/java/bisq/network/p2p/network/NetworkNode.java | 5 +++-- .../main/java/bisq/network/p2p/network/TorNetworkNode.java | 2 +- .../main/java/bisq/network/p2p/peers/BroadcastHandler.java | 3 ++- .../network/p2p/peers/getdata/GetDataRequestHandler.java | 3 ++- .../bisq/network/p2p/peers/getdata/RequestDataHandler.java | 3 ++- .../bisq/network/p2p/peers/keepalive/KeepAliveHandler.java | 3 ++- .../bisq/network/p2p/peers/keepalive/KeepAliveManager.java | 3 ++- .../p2p/peers/peerexchange/GetPeersRequestHandler.java | 3 ++- .../p2p/peers/peerexchange/PeerExchangeHandler.java | 3 ++- .../java/bisq/network/p2p/network/TorNetworkNodeTest.java | 5 +++-- 30 files changed, 64 insertions(+), 37 deletions(-) diff --git a/core/src/main/java/bisq/core/btc/wallet/BtcWalletService.java b/core/src/main/java/bisq/core/btc/wallet/BtcWalletService.java index 0e0ee6f0e9d..745cce12cb5 100644 --- a/core/src/main/java/bisq/core/btc/wallet/BtcWalletService.java +++ b/core/src/main/java/bisq/core/btc/wallet/BtcWalletService.java @@ -50,6 +50,7 @@ import com.google.common.collect.ImmutableList; import com.google.common.util.concurrent.FutureCallback; import com.google.common.util.concurrent.Futures; +import com.google.common.util.concurrent.MoreExecutors; import org.spongycastle.crypto.params.KeyParameter; @@ -846,7 +847,7 @@ public void onFailure(@NotNull Throwable t) { log.error("Broadcasting double spending transaction failed. " + t.getMessage()); errorMessageHandler.handleErrorMessage(t.getMessage()); } - }); + }, MoreExecutors.directExecutor()); } } catch (InsufficientMoneyException e) { @@ -1001,7 +1002,7 @@ public String sendFunds(String fromAddress, AddressEntryException, InsufficientMoneyException { SendRequest sendRequest = getSendRequest(fromAddress, toAddress, receiverAmount, fee, aesKey, context); Wallet.SendResult sendResult = wallet.sendCoins(sendRequest); - Futures.addCallback(sendResult.broadcastComplete, callback); + Futures.addCallback(sendResult.broadcastComplete, callback, MoreExecutors.directExecutor()); printTx("sendFunds", sendResult.tx); return sendResult.tx.getHashAsString(); @@ -1018,7 +1019,7 @@ public String sendFundsForMultipleAddresses(Set fromAddresses, SendRequest request = getSendRequestForMultipleAddresses(fromAddresses, toAddress, receiverAmount, fee, changeAddress, aesKey); Wallet.SendResult sendResult = wallet.sendCoins(request); - Futures.addCallback(sendResult.broadcastComplete, callback); + Futures.addCallback(sendResult.broadcastComplete, callback, MoreExecutors.directExecutor()); printTx("sendFunds", sendResult.tx); return sendResult.tx.getHashAsString(); diff --git a/core/src/main/java/bisq/core/btc/wallet/TxBroadcaster.java b/core/src/main/java/bisq/core/btc/wallet/TxBroadcaster.java index 0576024a736..b6e3ee1ec17 100644 --- a/core/src/main/java/bisq/core/btc/wallet/TxBroadcaster.java +++ b/core/src/main/java/bisq/core/btc/wallet/TxBroadcaster.java @@ -29,6 +29,7 @@ import com.google.common.util.concurrent.FutureCallback; import com.google.common.util.concurrent.Futures; +import com.google.common.util.concurrent.MoreExecutors; import java.util.HashMap; import java.util.Map; @@ -129,7 +130,7 @@ public void onFailure(@NotNull Throwable throwable) { UserThread.execute(() -> callback.onFailure(new TxBroadcastException("We got an onFailure from " + "the peerGroup.broadcastTransaction callback.", throwable))); } - }); + }, MoreExecutors.directExecutor()); } private static void stopAndRemoveTimer(String txId) { diff --git a/core/src/main/java/bisq/core/btc/wallet/WalletService.java b/core/src/main/java/bisq/core/btc/wallet/WalletService.java index 62822c4a0ad..136d61fd5aa 100644 --- a/core/src/main/java/bisq/core/btc/wallet/WalletService.java +++ b/core/src/main/java/bisq/core/btc/wallet/WalletService.java @@ -66,6 +66,7 @@ import com.google.common.util.concurrent.FutureCallback; import com.google.common.util.concurrent.Futures; +import com.google.common.util.concurrent.MoreExecutors; import javafx.beans.property.IntegerProperty; import javafx.beans.property.SimpleIntegerProperty; @@ -495,7 +496,7 @@ public void onFailure(@NotNull Throwable t) { log.error("emptyWallet onFailure " + t.toString()); errorMessageHandler.handleErrorMessage(t.getMessage()); } - }); + }, MoreExecutors.directExecutor()); } diff --git a/core/src/main/java/bisq/core/dao/governance/blindvote/network/RepublishGovernanceDataHandler.java b/core/src/main/java/bisq/core/dao/governance/blindvote/network/RepublishGovernanceDataHandler.java index edfa8046689..19192e543d0 100644 --- a/core/src/main/java/bisq/core/dao/governance/blindvote/network/RepublishGovernanceDataHandler.java +++ b/core/src/main/java/bisq/core/dao/governance/blindvote/network/RepublishGovernanceDataHandler.java @@ -35,6 +35,7 @@ import com.google.common.util.concurrent.FutureCallback; import com.google.common.util.concurrent.Futures; +import com.google.common.util.concurrent.MoreExecutors; import com.google.common.util.concurrent.SettableFuture; import java.util.ArrayList; @@ -135,7 +136,7 @@ public void onFailure(@NotNull Throwable throwable) { "Might be caused by an previous timeout."); } } - }); + }, MoreExecutors.directExecutor()); } private void connectToNextNode() { diff --git a/core/src/main/java/bisq/core/dao/monitoring/network/RequestStateHashesHandler.java b/core/src/main/java/bisq/core/dao/monitoring/network/RequestStateHashesHandler.java index fc7f23d176a..cc41c56ef62 100644 --- a/core/src/main/java/bisq/core/dao/monitoring/network/RequestStateHashesHandler.java +++ b/core/src/main/java/bisq/core/dao/monitoring/network/RequestStateHashesHandler.java @@ -33,6 +33,7 @@ import com.google.common.util.concurrent.FutureCallback; import com.google.common.util.concurrent.Futures; +import com.google.common.util.concurrent.MoreExecutors; import com.google.common.util.concurrent.SettableFuture; import java.util.Optional; @@ -151,7 +152,7 @@ public void onFailure(@NotNull Throwable throwable) { "Might be caused by an previous timeout."); } } - }); + }, MoreExecutors.directExecutor()); } else { log.warn("We have stopped already. We ignore that requestProposalsHash call."); } diff --git a/core/src/main/java/bisq/core/dao/node/explorer/ExportJsonFilesService.java b/core/src/main/java/bisq/core/dao/node/explorer/ExportJsonFilesService.java index d747395653f..41897c9d31a 100644 --- a/core/src/main/java/bisq/core/dao/node/explorer/ExportJsonFilesService.java +++ b/core/src/main/java/bisq/core/dao/node/explorer/ExportJsonFilesService.java @@ -42,6 +42,7 @@ import com.google.common.util.concurrent.Futures; import com.google.common.util.concurrent.ListenableFuture; import com.google.common.util.concurrent.ListeningExecutorService; +import com.google.common.util.concurrent.MoreExecutors; import java.nio.file.Paths; @@ -167,7 +168,7 @@ public void onFailure(@NotNull Throwable throwable) { log.error(throwable.toString()); throwable.printStackTrace(); } - }); + }, MoreExecutors.directExecutor()); } } diff --git a/core/src/main/java/bisq/core/dao/node/full/RpcService.java b/core/src/main/java/bisq/core/dao/node/full/RpcService.java index 1c43396e3e3..fed5fa0f91d 100644 --- a/core/src/main/java/bisq/core/dao/node/full/RpcService.java +++ b/core/src/main/java/bisq/core/dao/node/full/RpcService.java @@ -53,6 +53,7 @@ import com.google.common.util.concurrent.Futures; import com.google.common.util.concurrent.ListenableFuture; import com.google.common.util.concurrent.ListeningExecutorService; +import com.google.common.util.concurrent.MoreExecutors; import java.util.List; import java.util.Properties; @@ -162,7 +163,7 @@ public void onSuccess(Void ignore) { public void onFailure(@NotNull Throwable throwable) { UserThread.execute(() -> errorHandler.accept(throwable)); } - }); + }, MoreExecutors.directExecutor()); } void addNewBtcBlockHandler(Consumer btcBlockHandler, @@ -204,7 +205,7 @@ public void onSuccess(Integer chainHeight) { public void onFailure(@NotNull Throwable throwable) { UserThread.execute(() -> errorHandler.accept(throwable)); } - }); + }, MoreExecutors.directExecutor()); } void requestBtcBlock(int blockHeight, @@ -237,7 +238,7 @@ public void onFailure(@NotNull Throwable throwable) { log.error("Error at requestBtcBlock: blockHeight={}", blockHeight); UserThread.execute(() -> errorHandler.accept(throwable)); } - }); + }, MoreExecutors.directExecutor()); } diff --git a/core/src/main/java/bisq/core/dao/node/full/network/GetBlocksRequestHandler.java b/core/src/main/java/bisq/core/dao/node/full/network/GetBlocksRequestHandler.java index e741afabcca..baf54c9624c 100644 --- a/core/src/main/java/bisq/core/dao/node/full/network/GetBlocksRequestHandler.java +++ b/core/src/main/java/bisq/core/dao/node/full/network/GetBlocksRequestHandler.java @@ -32,6 +32,7 @@ import com.google.common.util.concurrent.FutureCallback; import com.google.common.util.concurrent.Futures; +import com.google.common.util.concurrent.MoreExecutors; import com.google.common.util.concurrent.SettableFuture; import java.util.LinkedList; @@ -129,7 +130,7 @@ public void onFailure(@NotNull Throwable throwable) { log.trace("We have stopped already. We ignore that networkNode.sendMessage.onFailure call."); } } - }); + }, MoreExecutors.directExecutor()); } public void stop() { diff --git a/core/src/main/java/bisq/core/dao/node/lite/network/RequestBlocksHandler.java b/core/src/main/java/bisq/core/dao/node/lite/network/RequestBlocksHandler.java index a78546e3eac..e0c98f30e1b 100644 --- a/core/src/main/java/bisq/core/dao/node/lite/network/RequestBlocksHandler.java +++ b/core/src/main/java/bisq/core/dao/node/lite/network/RequestBlocksHandler.java @@ -33,6 +33,7 @@ import com.google.common.util.concurrent.FutureCallback; import com.google.common.util.concurrent.Futures; +import com.google.common.util.concurrent.MoreExecutors; import com.google.common.util.concurrent.SettableFuture; import java.util.Random; @@ -153,7 +154,7 @@ public void onFailure(@NotNull Throwable throwable) { "Might be caused by an previous timeout."); } } - }); + }, MoreExecutors.directExecutor()); } else { log.warn("We have stopped already. We ignore that requestData call."); } diff --git a/core/src/main/java/bisq/core/notifications/MobileNotificationService.java b/core/src/main/java/bisq/core/notifications/MobileNotificationService.java index 3b80e0f8940..ee838e7c9c7 100644 --- a/core/src/main/java/bisq/core/notifications/MobileNotificationService.java +++ b/core/src/main/java/bisq/core/notifications/MobileNotificationService.java @@ -36,6 +36,7 @@ import com.google.common.util.concurrent.Futures; import com.google.common.util.concurrent.ListenableFuture; import com.google.common.util.concurrent.ListeningExecutorService; +import com.google.common.util.concurrent.MoreExecutors; import org.apache.commons.codec.binary.Hex; @@ -311,6 +312,6 @@ public void onSuccess(String result) { public void onFailure(@NotNull Throwable throwable) { UserThread.execute(() -> errorHandler.accept(throwable)); } - }); + }, MoreExecutors.directExecutor()); } } diff --git a/core/src/main/java/bisq/core/provider/fee/FeeRequest.java b/core/src/main/java/bisq/core/provider/fee/FeeRequest.java index f9a2b256677..5dcb7e2ae25 100644 --- a/core/src/main/java/bisq/core/provider/fee/FeeRequest.java +++ b/core/src/main/java/bisq/core/provider/fee/FeeRequest.java @@ -24,6 +24,7 @@ import com.google.common.util.concurrent.Futures; import com.google.common.util.concurrent.ListenableFuture; import com.google.common.util.concurrent.ListeningExecutorService; +import com.google.common.util.concurrent.MoreExecutors; import com.google.common.util.concurrent.SettableFuture; import java.util.Map; @@ -57,7 +58,7 @@ public void onSuccess(Tuple2, Map> feeData) { public void onFailure(@NotNull Throwable throwable) { resultFuture.setException(throwable); } - }); + }, MoreExecutors.directExecutor()); return resultFuture; } diff --git a/core/src/main/java/bisq/core/provider/fee/FeeService.java b/core/src/main/java/bisq/core/provider/fee/FeeService.java index 979796a967b..1dca7d1cfe1 100644 --- a/core/src/main/java/bisq/core/provider/fee/FeeService.java +++ b/core/src/main/java/bisq/core/provider/fee/FeeService.java @@ -32,6 +32,7 @@ import com.google.common.util.concurrent.FutureCallback; import com.google.common.util.concurrent.Futures; +import com.google.common.util.concurrent.MoreExecutors; import com.google.common.util.concurrent.SettableFuture; import javafx.beans.property.IntegerProperty; @@ -169,7 +170,7 @@ public void onFailure(@NotNull Throwable throwable) { if (faultHandler != null) UserThread.execute(() -> faultHandler.handleFault("Could not load fees", throwable)); } - }); + }, MoreExecutors.directExecutor()); } else { log.debug("We got a requestFees called again before min pause of {} minutes has passed.", MIN_PAUSE_BETWEEN_REQUESTS_IN_MIN); UserThread.execute(() -> { diff --git a/core/src/main/java/bisq/core/provider/price/PriceFeedService.java b/core/src/main/java/bisq/core/provider/price/PriceFeedService.java index 09e8ed93559..30b2a4f4ce4 100644 --- a/core/src/main/java/bisq/core/provider/price/PriceFeedService.java +++ b/core/src/main/java/bisq/core/provider/price/PriceFeedService.java @@ -38,6 +38,7 @@ import com.google.common.util.concurrent.FutureCallback; import com.google.common.util.concurrent.Futures; +import com.google.common.util.concurrent.MoreExecutors; import com.google.common.util.concurrent.SettableFuture; import javafx.beans.property.IntegerProperty; @@ -413,6 +414,6 @@ public void onSuccess(@Nullable Tuple2, Map faultHandler.handleFault("Could not load marketPrices", throwable)); } - }); + }, MoreExecutors.directExecutor()); } } diff --git a/core/src/main/java/bisq/core/provider/price/PriceRequest.java b/core/src/main/java/bisq/core/provider/price/PriceRequest.java index 04718345d9f..bd0fb8d7cbe 100644 --- a/core/src/main/java/bisq/core/provider/price/PriceRequest.java +++ b/core/src/main/java/bisq/core/provider/price/PriceRequest.java @@ -24,6 +24,7 @@ import com.google.common.util.concurrent.Futures; import com.google.common.util.concurrent.ListenableFuture; import com.google.common.util.concurrent.ListeningExecutorService; +import com.google.common.util.concurrent.MoreExecutors; import com.google.common.util.concurrent.SettableFuture; import java.util.Map; @@ -56,7 +57,7 @@ public void onSuccess(Tuple2, Map> market public void onFailure(@NotNull Throwable throwable) { resultFuture.setException(new PriceRequestException(throwable, baseUrl)); } - }); + }, MoreExecutors.directExecutor()); return resultFuture; } diff --git a/core/src/main/java/bisq/core/trade/Trade.java b/core/src/main/java/bisq/core/trade/Trade.java index dd14c4f092a..4ef40d4e1c7 100644 --- a/core/src/main/java/bisq/core/trade/Trade.java +++ b/core/src/main/java/bisq/core/trade/Trade.java @@ -63,6 +63,7 @@ import com.google.common.util.concurrent.FutureCallback; import com.google.common.util.concurrent.Futures; import com.google.common.util.concurrent.ListenableFuture; +import com.google.common.util.concurrent.MoreExecutors; import javafx.beans.property.ObjectProperty; import javafx.beans.property.ReadOnlyObjectProperty; @@ -932,7 +933,7 @@ public void onFailure(@NotNull Throwable t) { log.error(t.getMessage()); throw new RuntimeException(t); } - }); + }, MoreExecutors.directExecutor()); } } else { log.error("depositTx == null. That must not happen."); diff --git a/desktop/src/main/java/bisq/desktop/main/offer/MutableOfferDataModel.java b/desktop/src/main/java/bisq/desktop/main/offer/MutableOfferDataModel.java index 67f5188062d..b3e3cbb81e7 100644 --- a/desktop/src/main/java/bisq/desktop/main/offer/MutableOfferDataModel.java +++ b/desktop/src/main/java/bisq/desktop/main/offer/MutableOfferDataModel.java @@ -208,7 +208,7 @@ public void onFailure(@NotNull Throwable throwable) { .onClose(() -> feeFromFundingTxProperty.set(Coin.ZERO)) .show()); } - }); + }, MoreExecutors.directExecutor()); }*/ } }; diff --git a/desktop/src/main/java/bisq/desktop/main/offer/takeoffer/TakeOfferDataModel.java b/desktop/src/main/java/bisq/desktop/main/offer/takeoffer/TakeOfferDataModel.java index 5d2dfabbc0f..cb7296568ef 100644 --- a/desktop/src/main/java/bisq/desktop/main/offer/takeoffer/TakeOfferDataModel.java +++ b/desktop/src/main/java/bisq/desktop/main/offer/takeoffer/TakeOfferDataModel.java @@ -252,7 +252,7 @@ public void onFailure(@NotNull Throwable throwable) { .onClose(() -> setFeeFromFundingTx(Coin.NEGATIVE_SATOSHI)) .show()); } - }); + }, MoreExecutors.directExecutor()); } else { setFeeFromFundingTx(FeePolicy.getMinRequiredFeeForFundingTx()); isFeeFromFundingTxSufficient.set(feeFromFundingTx.compareTo(FeePolicy.getMinRequiredFeeForFundingTx()) >= 0); diff --git a/monitor/src/main/java/bisq/monitor/metric/P2PRoundTripTime.java b/monitor/src/main/java/bisq/monitor/metric/P2PRoundTripTime.java index 0cd7ff75951..6269a31dc30 100644 --- a/monitor/src/main/java/bisq/monitor/metric/P2PRoundTripTime.java +++ b/monitor/src/main/java/bisq/monitor/metric/P2PRoundTripTime.java @@ -42,6 +42,7 @@ import com.google.common.util.concurrent.FutureCallback; import com.google.common.util.concurrent.Futures; +import com.google.common.util.concurrent.MoreExecutors; import com.google.common.util.concurrent.SettableFuture; import java.io.File; @@ -121,7 +122,7 @@ public void onFailure(@NotNull Throwable throwable) { log.error("Sending ping failed. That is expected if the peer is offline.\n\tException=" + throwable.getMessage()); } - }); + }, MoreExecutors.directExecutor()); // wait for the gate to open again gate.await(); diff --git a/monitor/src/main/java/bisq/monitor/metric/P2PSeedNodeSnapshot.java b/monitor/src/main/java/bisq/monitor/metric/P2PSeedNodeSnapshot.java index c213dd86f90..856e4aeaee8 100644 --- a/monitor/src/main/java/bisq/monitor/metric/P2PSeedNodeSnapshot.java +++ b/monitor/src/main/java/bisq/monitor/metric/P2PSeedNodeSnapshot.java @@ -43,6 +43,7 @@ import com.google.common.util.concurrent.FutureCallback; import com.google.common.util.concurrent.Futures; +import com.google.common.util.concurrent.MoreExecutors; import com.google.common.util.concurrent.SettableFuture; import java.net.MalformedURLException; @@ -190,7 +191,7 @@ public void onFailure(@NotNull Throwable throwable) { "Sending PreliminaryDataRequest failed. That is expected if the peer is offline.\n\tException=" + throwable.getMessage()); } - }); + }, MoreExecutors.directExecutor()); } catch (Exception e) { gate.proceed(); // release the gate on error diff --git a/p2p/src/main/java/bisq/network/p2p/P2PService.java b/p2p/src/main/java/bisq/network/p2p/P2PService.java index e3696025238..964d250e0b8 100644 --- a/p2p/src/main/java/bisq/network/p2p/P2PService.java +++ b/p2p/src/main/java/bisq/network/p2p/P2PService.java @@ -60,6 +60,7 @@ import com.google.common.annotations.VisibleForTesting; import com.google.common.util.concurrent.FutureCallback; import com.google.common.util.concurrent.Futures; +import com.google.common.util.concurrent.MoreExecutors; import com.google.common.util.concurrent.SettableFuture; import org.fxmisc.easybind.EasyBind; @@ -492,7 +493,7 @@ public void onFailure(@NotNull Throwable throwable) { throwable.printStackTrace(); sendDirectMessageListener.onFault(throwable.toString()); } - }); + }, MoreExecutors.directExecutor()); } catch (CryptoException e) { e.printStackTrace(); log.error(message.toString()); @@ -595,7 +596,7 @@ public void onFailure(@NotNull Throwable throwable) { receiverStoragePublicKey, sendMailboxMessageListener); } - }); + }, MoreExecutors.directExecutor()); } catch (CryptoException e) { log.error("sendEncryptedMessage failed"); e.printStackTrace(); diff --git a/p2p/src/main/java/bisq/network/p2p/network/NetworkNode.java b/p2p/src/main/java/bisq/network/p2p/network/NetworkNode.java index caac29de1db..205911697de 100644 --- a/p2p/src/main/java/bisq/network/p2p/network/NetworkNode.java +++ b/p2p/src/main/java/bisq/network/p2p/network/NetworkNode.java @@ -30,6 +30,7 @@ import com.google.common.util.concurrent.Futures; import com.google.common.util.concurrent.ListenableFuture; import com.google.common.util.concurrent.ListeningExecutorService; +import com.google.common.util.concurrent.MoreExecutors; import com.google.common.util.concurrent.SettableFuture; import javafx.beans.property.ObjectProperty; @@ -213,7 +214,7 @@ public void onFailure(@NotNull Throwable throwable) { log.info("onFailure at sendMessage: peersNodeAddress={}\n\tmessage={}\n\tthrowable={}", peersNodeAddress, networkEnvelope.getClass().getSimpleName(), throwable.toString()); UserThread.execute(() -> resultFuture.setException(throwable)); } - }); + }, MoreExecutors.directExecutor()); return resultFuture; } @@ -277,7 +278,7 @@ public void onSuccess(Connection connection) { public void onFailure(@NotNull Throwable throwable) { UserThread.execute(() -> resultFuture.setException(throwable)); } - }); + }, MoreExecutors.directExecutor()); return resultFuture; } diff --git a/p2p/src/main/java/bisq/network/p2p/network/TorNetworkNode.java b/p2p/src/main/java/bisq/network/p2p/network/TorNetworkNode.java index 6659c603640..14a3ebd806a 100644 --- a/p2p/src/main/java/bisq/network/p2p/network/TorNetworkNode.java +++ b/p2p/src/main/java/bisq/network/p2p/network/TorNetworkNode.java @@ -310,6 +310,6 @@ public void onSuccess(Void ignore) { public void onFailure(@NotNull Throwable throwable) { UserThread.execute(() -> log.error("Hidden service creation failed: " + throwable)); } - }); + }, MoreExecutors.directExecutor()); } } diff --git a/p2p/src/main/java/bisq/network/p2p/peers/BroadcastHandler.java b/p2p/src/main/java/bisq/network/p2p/peers/BroadcastHandler.java index dde4062d20a..4b3bac0ebe3 100644 --- a/p2p/src/main/java/bisq/network/p2p/peers/BroadcastHandler.java +++ b/p2p/src/main/java/bisq/network/p2p/peers/BroadcastHandler.java @@ -28,6 +28,7 @@ import com.google.common.util.concurrent.FutureCallback; import com.google.common.util.concurrent.Futures; +import com.google.common.util.concurrent.MoreExecutors; import com.google.common.util.concurrent.SettableFuture; import java.util.ArrayList; @@ -204,7 +205,7 @@ public void onFailure(@NotNull Throwable throwable) { onFault("stopped at onFailure: " + errorMessage); } } - }); + }, MoreExecutors.directExecutor()); } } else { onFault("Connection stopped already", false); diff --git a/p2p/src/main/java/bisq/network/p2p/peers/getdata/GetDataRequestHandler.java b/p2p/src/main/java/bisq/network/p2p/peers/getdata/GetDataRequestHandler.java index 35e6c9ec217..a14d471123c 100644 --- a/p2p/src/main/java/bisq/network/p2p/peers/getdata/GetDataRequestHandler.java +++ b/p2p/src/main/java/bisq/network/p2p/peers/getdata/GetDataRequestHandler.java @@ -35,6 +35,7 @@ import com.google.common.util.concurrent.FutureCallback; import com.google.common.util.concurrent.Futures; +import com.google.common.util.concurrent.MoreExecutors; import com.google.common.util.concurrent.SettableFuture; import java.util.HashSet; @@ -129,7 +130,7 @@ public void onFailure(@NotNull Throwable throwable) { log.trace("We have stopped already. We ignore that networkNode.sendMessage.onFailure call."); } } - }); + }, MoreExecutors.directExecutor()); } private Set getFilteredPersistableNetworkPayload(GetDataRequest getDataRequest, Connection connection) { diff --git a/p2p/src/main/java/bisq/network/p2p/peers/getdata/RequestDataHandler.java b/p2p/src/main/java/bisq/network/p2p/peers/getdata/RequestDataHandler.java index 654be9ab4ae..3737d3cd868 100644 --- a/p2p/src/main/java/bisq/network/p2p/peers/getdata/RequestDataHandler.java +++ b/p2p/src/main/java/bisq/network/p2p/peers/getdata/RequestDataHandler.java @@ -40,6 +40,7 @@ import com.google.common.util.concurrent.FutureCallback; import com.google.common.util.concurrent.Futures; +import com.google.common.util.concurrent.MoreExecutors; import com.google.common.util.concurrent.SettableFuture; import java.util.ArrayList; @@ -179,7 +180,7 @@ public void onFailure(@NotNull Throwable throwable) { "Might be caused by an previous timeout."); } } - }); + }, MoreExecutors.directExecutor()); } else { log.warn("We have stopped already. We ignore that requestData call."); } diff --git a/p2p/src/main/java/bisq/network/p2p/peers/keepalive/KeepAliveHandler.java b/p2p/src/main/java/bisq/network/p2p/peers/keepalive/KeepAliveHandler.java index bda50cf3b16..10e39fbcd08 100644 --- a/p2p/src/main/java/bisq/network/p2p/peers/keepalive/KeepAliveHandler.java +++ b/p2p/src/main/java/bisq/network/p2p/peers/keepalive/KeepAliveHandler.java @@ -30,6 +30,7 @@ import com.google.common.util.concurrent.FutureCallback; import com.google.common.util.concurrent.Futures; +import com.google.common.util.concurrent.MoreExecutors; import com.google.common.util.concurrent.SettableFuture; import java.util.Random; @@ -129,7 +130,7 @@ public void onFailure(@NotNull Throwable throwable) { log.trace("We have stopped already. We ignore that networkNode.sendMessage.onFailure call."); } } - }); + }, MoreExecutors.directExecutor()); } else { log.trace("We have stopped already. We ignore that sendPing call."); } diff --git a/p2p/src/main/java/bisq/network/p2p/peers/keepalive/KeepAliveManager.java b/p2p/src/main/java/bisq/network/p2p/peers/keepalive/KeepAliveManager.java index 6115df52e20..d472d9b652c 100644 --- a/p2p/src/main/java/bisq/network/p2p/peers/keepalive/KeepAliveManager.java +++ b/p2p/src/main/java/bisq/network/p2p/peers/keepalive/KeepAliveManager.java @@ -35,6 +35,7 @@ import com.google.common.util.concurrent.FutureCallback; import com.google.common.util.concurrent.Futures; +import com.google.common.util.concurrent.MoreExecutors; import com.google.common.util.concurrent.SettableFuture; import java.util.HashMap; @@ -126,7 +127,7 @@ public void onFailure(@NotNull Throwable throwable) { log.warn("We have stopped already. We ignore that networkNode.sendMessage.onFailure call."); } } - }); + }, MoreExecutors.directExecutor()); } else { log.warn("We have stopped already. We ignore that onMessage call."); } diff --git a/p2p/src/main/java/bisq/network/p2p/peers/peerexchange/GetPeersRequestHandler.java b/p2p/src/main/java/bisq/network/p2p/peers/peerexchange/GetPeersRequestHandler.java index d9f627f8291..3688d85621c 100644 --- a/p2p/src/main/java/bisq/network/p2p/peers/peerexchange/GetPeersRequestHandler.java +++ b/p2p/src/main/java/bisq/network/p2p/peers/peerexchange/GetPeersRequestHandler.java @@ -29,6 +29,7 @@ import com.google.common.util.concurrent.FutureCallback; import com.google.common.util.concurrent.Futures; +import com.google.common.util.concurrent.MoreExecutors; import com.google.common.util.concurrent.SettableFuture; import java.util.concurrent.TimeUnit; @@ -128,7 +129,7 @@ public void onFailure(@NotNull Throwable throwable) { log.trace("We have stopped already. We ignore that networkNode.sendMessage.onFailure call."); } } - }); + }, MoreExecutors.directExecutor()); peerManager.addToReportedPeers(getPeersRequest.getReportedPeers(), connection); } diff --git a/p2p/src/main/java/bisq/network/p2p/peers/peerexchange/PeerExchangeHandler.java b/p2p/src/main/java/bisq/network/p2p/peers/peerexchange/PeerExchangeHandler.java index e8d9c08bc0e..9358084a3b8 100644 --- a/p2p/src/main/java/bisq/network/p2p/peers/peerexchange/PeerExchangeHandler.java +++ b/p2p/src/main/java/bisq/network/p2p/peers/peerexchange/PeerExchangeHandler.java @@ -32,6 +32,7 @@ import com.google.common.util.concurrent.FutureCallback; import com.google.common.util.concurrent.Futures; +import com.google.common.util.concurrent.MoreExecutors; import com.google.common.util.concurrent.SettableFuture; import java.util.Random; @@ -144,7 +145,7 @@ public void onFailure(@NotNull Throwable throwable) { log.trace("We have stopped that handler already. We ignore that sendGetPeersRequest.onFailure call."); } } - }); + }, MoreExecutors.directExecutor()); } else { log.debug("My node address is still null at sendGetPeersRequest. We ignore that call."); } diff --git a/p2p/src/test/java/bisq/network/p2p/network/TorNetworkNodeTest.java b/p2p/src/test/java/bisq/network/p2p/network/TorNetworkNodeTest.java index f4b2ac66b2a..427bde476a6 100644 --- a/p2p/src/test/java/bisq/network/p2p/network/TorNetworkNodeTest.java +++ b/p2p/src/test/java/bisq/network/p2p/network/TorNetworkNodeTest.java @@ -22,6 +22,7 @@ import com.google.common.util.concurrent.FutureCallback; import com.google.common.util.concurrent.Futures; +import com.google.common.util.concurrent.MoreExecutors; import com.google.common.util.concurrent.SettableFuture; import java.io.File; @@ -124,7 +125,7 @@ public void onSuccess(Connection connection) { public void onFailure(@NotNull Throwable throwable) { log.debug("onFailure "); } - }); + }, MoreExecutors.directExecutor()); latch.await(); @@ -207,7 +208,7 @@ public void onSuccess(Connection connection) { public void onFailure(@NotNull Throwable throwable) { log.debug("onFailure "); } - }); + }, MoreExecutors.directExecutor()); latch.await(); From 3e2c879857f3063466c96b97a28c915cc74614ae Mon Sep 17 00:00:00 2001 From: Oscar Guindzberg Date: Mon, 8 Apr 2019 18:32:54 -0300 Subject: [PATCH 07/30] bitcoinj 0.15: Use new Wallet.toString() with includeLookAhead boolean param. --- core/src/main/java/bisq/core/btc/wallet/BsqWalletService.java | 2 +- core/src/main/java/bisq/core/btc/wallet/BtcWalletService.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/core/src/main/java/bisq/core/btc/wallet/BsqWalletService.java b/core/src/main/java/bisq/core/btc/wallet/BsqWalletService.java index 49018f8bca9..ed3de95eb7d 100644 --- a/core/src/main/java/bisq/core/btc/wallet/BsqWalletService.java +++ b/core/src/main/java/bisq/core/btc/wallet/BsqWalletService.java @@ -204,7 +204,7 @@ public void onParseBlockCompleteAfterBatchProcessing(Block block) { @Override String getWalletAsString(boolean includePrivKeys) { - return wallet.toString(includePrivKeys, true, true, walletsSetup.getChain()) + "\n\n" + + return wallet.toString(true, includePrivKeys, null, true, true, walletsSetup.getChain()) + "\n\n" + "All pubKeys as hex:\n" + wallet.printAllPubKeysAsHex(); } diff --git a/core/src/main/java/bisq/core/btc/wallet/BtcWalletService.java b/core/src/main/java/bisq/core/btc/wallet/BtcWalletService.java index 745cce12cb5..c39cc407498 100644 --- a/core/src/main/java/bisq/core/btc/wallet/BtcWalletService.java +++ b/core/src/main/java/bisq/core/btc/wallet/BtcWalletService.java @@ -135,7 +135,7 @@ String getWalletAsString(boolean includePrivKeys) { return "Address entry list:\n" + sb.toString() + "\n\n" + - wallet.toString(includePrivKeys, true, true, walletsSetup.getChain()) + "\n\n" + + wallet.toString(true, includePrivKeys, null, true, true, walletsSetup.getChain()) + "\n\n" + "All pubKeys as hex:\n" + wallet.printAllPubKeysAsHex(); } From 94a1d990713fffa84819b83f2256de07f424e412 Mon Sep 17 00:00:00 2001 From: Oscar Guindzberg Date: Tue, 9 Apr 2019 12:02:06 -0300 Subject: [PATCH 08/30] bitcoinj 0.15: bitcoinj moved from spongycastle to bouncycastle. --- common/src/main/java/bisq/common/crypto/Hash.java | 2 +- core/src/main/java/bisq/core/app/BisqSetup.java | 2 +- .../java/bisq/core/btc/setup/BisqDeterministicKeyChain.java | 2 +- .../main/java/bisq/core/btc/setup/BtcDeterministicKeyChain.java | 2 +- core/src/main/java/bisq/core/btc/wallet/BtcWalletService.java | 2 +- core/src/main/java/bisq/core/btc/wallet/TradeWalletService.java | 2 +- core/src/main/java/bisq/core/btc/wallet/WalletService.java | 2 +- core/src/main/java/bisq/core/btc/wallet/WalletsManager.java | 2 +- core/src/main/java/bisq/core/crypto/ScryptUtil.java | 2 +- core/src/main/java/bisq/core/trade/TradeManager.java | 2 +- .../java/bisq/desktop/main/funds/withdrawal/WithdrawalView.java | 2 +- .../bisq/desktop/main/overlays/windows/EmptyWalletWindow.java | 2 +- .../desktop/main/overlays/windows/WalletPasswordWindow.java | 2 +- .../main/portfolio/pendingtrades/PendingTradesDataModel.java | 2 +- .../portfolio/pendingtrades/steps/buyer/BuyerStep4View.java | 2 +- 15 files changed, 15 insertions(+), 15 deletions(-) diff --git a/common/src/main/java/bisq/common/crypto/Hash.java b/common/src/main/java/bisq/common/crypto/Hash.java index 078582266a9..7a3d9429106 100644 --- a/common/src/main/java/bisq/common/crypto/Hash.java +++ b/common/src/main/java/bisq/common/crypto/Hash.java @@ -21,7 +21,7 @@ import com.google.common.base.Charsets; -import org.spongycastle.crypto.digests.RIPEMD160Digest; +import org.bouncycastle.crypto.digests.RIPEMD160Digest; import java.security.MessageDigest; import java.security.NoSuchAlgorithmException; diff --git a/core/src/main/java/bisq/core/app/BisqSetup.java b/core/src/main/java/bisq/core/app/BisqSetup.java index 26cc912e6c7..f075f4f20ee 100644 --- a/core/src/main/java/bisq/core/app/BisqSetup.java +++ b/core/src/main/java/bisq/core/app/BisqSetup.java @@ -87,7 +87,7 @@ import javafx.collections.ListChangeListener; import javafx.collections.SetChangeListener; -import org.spongycastle.crypto.params.KeyParameter; +import org.bouncycastle.crypto.params.KeyParameter; import java.net.InetSocketAddress; import java.net.Socket; diff --git a/core/src/main/java/bisq/core/btc/setup/BisqDeterministicKeyChain.java b/core/src/main/java/bisq/core/btc/setup/BisqDeterministicKeyChain.java index e0d53ddd156..25cd30da6b6 100644 --- a/core/src/main/java/bisq/core/btc/setup/BisqDeterministicKeyChain.java +++ b/core/src/main/java/bisq/core/btc/setup/BisqDeterministicKeyChain.java @@ -25,7 +25,7 @@ import com.google.common.collect.ImmutableList; -import org.spongycastle.crypto.params.KeyParameter; +import org.bouncycastle.crypto.params.KeyParameter; import java.security.SecureRandom; diff --git a/core/src/main/java/bisq/core/btc/setup/BtcDeterministicKeyChain.java b/core/src/main/java/bisq/core/btc/setup/BtcDeterministicKeyChain.java index fd177aa71a1..188ea04ae82 100644 --- a/core/src/main/java/bisq/core/btc/setup/BtcDeterministicKeyChain.java +++ b/core/src/main/java/bisq/core/btc/setup/BtcDeterministicKeyChain.java @@ -25,7 +25,7 @@ import com.google.common.collect.ImmutableList; -import org.spongycastle.crypto.params.KeyParameter; +import org.bouncycastle.crypto.params.KeyParameter; import java.security.SecureRandom; diff --git a/core/src/main/java/bisq/core/btc/wallet/BtcWalletService.java b/core/src/main/java/bisq/core/btc/wallet/BtcWalletService.java index c39cc407498..00e55abf6fe 100644 --- a/core/src/main/java/bisq/core/btc/wallet/BtcWalletService.java +++ b/core/src/main/java/bisq/core/btc/wallet/BtcWalletService.java @@ -52,7 +52,7 @@ import com.google.common.util.concurrent.Futures; import com.google.common.util.concurrent.MoreExecutors; -import org.spongycastle.crypto.params.KeyParameter; +import org.bouncycastle.crypto.params.KeyParameter; import java.util.Arrays; import java.util.List; diff --git a/core/src/main/java/bisq/core/btc/wallet/TradeWalletService.java b/core/src/main/java/bisq/core/btc/wallet/TradeWalletService.java index 3db2070e5d4..275d89d0a6d 100644 --- a/core/src/main/java/bisq/core/btc/wallet/TradeWalletService.java +++ b/core/src/main/java/bisq/core/btc/wallet/TradeWalletService.java @@ -56,7 +56,7 @@ import com.google.common.collect.ImmutableList; -import org.spongycastle.crypto.params.KeyParameter; +import org.bouncycastle.crypto.params.KeyParameter; import java.util.ArrayList; import java.util.List; diff --git a/core/src/main/java/bisq/core/btc/wallet/WalletService.java b/core/src/main/java/bisq/core/btc/wallet/WalletService.java index 136d61fd5aa..9f4ad0559a6 100644 --- a/core/src/main/java/bisq/core/btc/wallet/WalletService.java +++ b/core/src/main/java/bisq/core/btc/wallet/WalletService.java @@ -71,7 +71,7 @@ import javafx.beans.property.IntegerProperty; import javafx.beans.property.SimpleIntegerProperty; -import org.spongycastle.crypto.params.KeyParameter; +import org.bouncycastle.crypto.params.KeyParameter; import java.util.ArrayList; import java.util.List; diff --git a/core/src/main/java/bisq/core/btc/wallet/WalletsManager.java b/core/src/main/java/bisq/core/btc/wallet/WalletsManager.java index 7ad96b256ed..5e5864a34d9 100644 --- a/core/src/main/java/bisq/core/btc/wallet/WalletsManager.java +++ b/core/src/main/java/bisq/core/btc/wallet/WalletsManager.java @@ -34,7 +34,7 @@ import com.google.inject.Inject; -import org.spongycastle.crypto.params.KeyParameter; +import org.bouncycastle.crypto.params.KeyParameter; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/core/src/main/java/bisq/core/crypto/ScryptUtil.java b/core/src/main/java/bisq/core/crypto/ScryptUtil.java index aebd5241bf5..d3d7c2c8ac7 100644 --- a/core/src/main/java/bisq/core/crypto/ScryptUtil.java +++ b/core/src/main/java/bisq/core/crypto/ScryptUtil.java @@ -25,7 +25,7 @@ import org.bitcoinj.crypto.KeyCrypterScrypt; import org.bitcoinj.wallet.Protos; -import org.spongycastle.crypto.params.KeyParameter; +import org.bouncycastle.crypto.params.KeyParameter; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/core/src/main/java/bisq/core/trade/TradeManager.java b/core/src/main/java/bisq/core/trade/TradeManager.java index 4e70e45ad6e..3195d9afb22 100644 --- a/core/src/main/java/bisq/core/trade/TradeManager.java +++ b/core/src/main/java/bisq/core/trade/TradeManager.java @@ -76,7 +76,7 @@ import javafx.collections.ListChangeListener; import javafx.collections.ObservableList; -import org.spongycastle.crypto.params.KeyParameter; +import org.bouncycastle.crypto.params.KeyParameter; import java.io.File; diff --git a/desktop/src/main/java/bisq/desktop/main/funds/withdrawal/WithdrawalView.java b/desktop/src/main/java/bisq/desktop/main/funds/withdrawal/WithdrawalView.java index f3565535d0a..2aab436626f 100644 --- a/desktop/src/main/java/bisq/desktop/main/funds/withdrawal/WithdrawalView.java +++ b/desktop/src/main/java/bisq/desktop/main/funds/withdrawal/WithdrawalView.java @@ -93,7 +93,7 @@ import javafx.util.Callback; -import org.spongycastle.crypto.params.KeyParameter; +import org.bouncycastle.crypto.params.KeyParameter; import java.util.ArrayList; import java.util.Comparator; diff --git a/desktop/src/main/java/bisq/desktop/main/overlays/windows/EmptyWalletWindow.java b/desktop/src/main/java/bisq/desktop/main/overlays/windows/EmptyWalletWindow.java index c6d0af5bbb7..3a2a80e40e1 100644 --- a/desktop/src/main/java/bisq/desktop/main/overlays/windows/EmptyWalletWindow.java +++ b/desktop/src/main/java/bisq/desktop/main/overlays/windows/EmptyWalletWindow.java @@ -53,7 +53,7 @@ import javafx.geometry.Insets; -import org.spongycastle.crypto.params.KeyParameter; +import org.bouncycastle.crypto.params.KeyParameter; import java.util.concurrent.TimeUnit; diff --git a/desktop/src/main/java/bisq/desktop/main/overlays/windows/WalletPasswordWindow.java b/desktop/src/main/java/bisq/desktop/main/overlays/windows/WalletPasswordWindow.java index c1ebb84fa5d..c9161d6b30b 100644 --- a/desktop/src/main/java/bisq/desktop/main/overlays/windows/WalletPasswordWindow.java +++ b/desktop/src/main/java/bisq/desktop/main/overlays/windows/WalletPasswordWindow.java @@ -64,7 +64,7 @@ import javafx.beans.property.SimpleBooleanProperty; import javafx.beans.value.ChangeListener; -import org.spongycastle.crypto.params.KeyParameter; +import org.bouncycastle.crypto.params.KeyParameter; import java.time.Instant; import java.time.LocalDate; diff --git a/desktop/src/main/java/bisq/desktop/main/portfolio/pendingtrades/PendingTradesDataModel.java b/desktop/src/main/java/bisq/desktop/main/portfolio/pendingtrades/PendingTradesDataModel.java index 319f8dd8442..2f4302a4502 100644 --- a/desktop/src/main/java/bisq/desktop/main/portfolio/pendingtrades/PendingTradesDataModel.java +++ b/desktop/src/main/java/bisq/desktop/main/portfolio/pendingtrades/PendingTradesDataModel.java @@ -65,7 +65,7 @@ import javafx.collections.ListChangeListener; import javafx.collections.ObservableList; -import org.spongycastle.crypto.params.KeyParameter; +import org.bouncycastle.crypto.params.KeyParameter; import java.util.ArrayList; import java.util.List; diff --git a/desktop/src/main/java/bisq/desktop/main/portfolio/pendingtrades/steps/buyer/BuyerStep4View.java b/desktop/src/main/java/bisq/desktop/main/portfolio/pendingtrades/steps/buyer/BuyerStep4View.java index 96d94c4c668..215341eb309 100644 --- a/desktop/src/main/java/bisq/desktop/main/portfolio/pendingtrades/steps/buyer/BuyerStep4View.java +++ b/desktop/src/main/java/bisq/desktop/main/portfolio/pendingtrades/steps/buyer/BuyerStep4View.java @@ -59,7 +59,7 @@ import javafx.geometry.Insets; -import org.spongycastle.crypto.params.KeyParameter; +import org.bouncycastle.crypto.params.KeyParameter; import java.util.concurrent.TimeUnit; From b73cdfb6c638502d5a906134a9c3cb29450ab7d7 Mon Sep 17 00:00:00 2001 From: Oscar Guindzberg Date: Tue, 9 Apr 2019 12:28:40 -0300 Subject: [PATCH 09/30] bitcoinj 0.15: NetworkParameters.acceptableAddressCodes was removed. --- assets/src/main/java/bisq/asset/coins/Actinium.java | 1 - assets/src/main/java/bisq/asset/coins/Adeptio.java | 1 - assets/src/main/java/bisq/asset/coins/Australiacash.java | 1 - assets/src/main/java/bisq/asset/coins/BitcoinRhodium.java | 1 - assets/src/main/java/bisq/asset/coins/Bitmark.java | 1 - assets/src/main/java/bisq/asset/coins/Chaucha.java | 1 - assets/src/main/java/bisq/asset/coins/Credits.java | 3 +-- assets/src/main/java/bisq/asset/coins/DSTRA.java | 1 - assets/src/main/java/bisq/asset/coins/Dash.java | 1 - assets/src/main/java/bisq/asset/coins/DeepOnion.java | 1 - assets/src/main/java/bisq/asset/coins/Dextro.java | 1 - assets/src/main/java/bisq/asset/coins/Dogecoin.java | 1 - assets/src/main/java/bisq/asset/coins/Doichain.java | 1 - assets/src/main/java/bisq/asset/coins/Fujicoin.java | 1 - assets/src/main/java/bisq/asset/coins/Galilel.java | 1 - assets/src/main/java/bisq/asset/coins/GambleCoin.java | 1 - assets/src/main/java/bisq/asset/coins/Hatch.java | 1 - assets/src/main/java/bisq/asset/coins/Helium.java | 1 - assets/src/main/java/bisq/asset/coins/IdaPay.java | 1 - assets/src/main/java/bisq/asset/coins/Kekcoin.java | 3 +-- assets/src/main/java/bisq/asset/coins/Litecoin.java | 1 - assets/src/main/java/bisq/asset/coins/LitecoinPlus.java | 1 - assets/src/main/java/bisq/asset/coins/Lytix.java | 1 - assets/src/main/java/bisq/asset/coins/MobitGlobal.java | 1 - assets/src/main/java/bisq/asset/coins/MonetaryUnit.java | 1 - assets/src/main/java/bisq/asset/coins/Navcoin.java | 1 - assets/src/main/java/bisq/asset/coins/Neos.java | 1 - assets/src/main/java/bisq/asset/coins/PIVX.java | 1 - assets/src/main/java/bisq/asset/coins/PZDC.java | 1 - assets/src/main/java/bisq/asset/coins/Pinkcoin.java | 1 - assets/src/main/java/bisq/asset/coins/QMCoin.java | 1 - assets/src/main/java/bisq/asset/coins/Qbase.java | 1 - assets/src/main/java/bisq/asset/coins/Radium.java | 3 +-- assets/src/main/java/bisq/asset/coins/SUB1X.java | 1 - assets/src/main/java/bisq/asset/coins/Spectrecoin.java | 1 - assets/src/main/java/bisq/asset/coins/UnitedCommunityCoin.java | 1 - assets/src/main/java/bisq/asset/coins/Veil.java | 1 - 37 files changed, 3 insertions(+), 40 deletions(-) diff --git a/assets/src/main/java/bisq/asset/coins/Actinium.java b/assets/src/main/java/bisq/asset/coins/Actinium.java index d0bfc49b5dd..45f0941527c 100644 --- a/assets/src/main/java/bisq/asset/coins/Actinium.java +++ b/assets/src/main/java/bisq/asset/coins/Actinium.java @@ -33,7 +33,6 @@ public static class ActiniumParams extends NetworkParametersAdapter { public ActiniumParams() { addressHeader = 53; p2shHeader = 55; - acceptableAddressCodes = new int[]{addressHeader, p2shHeader}; } } } diff --git a/assets/src/main/java/bisq/asset/coins/Adeptio.java b/assets/src/main/java/bisq/asset/coins/Adeptio.java index ecfd4b34113..ae10025eccb 100644 --- a/assets/src/main/java/bisq/asset/coins/Adeptio.java +++ b/assets/src/main/java/bisq/asset/coins/Adeptio.java @@ -50,7 +50,6 @@ public static class AdeptioParams extends NetworkParametersAdapter { public AdeptioParams() { addressHeader = 23; p2shHeader = 16; - acceptableAddressCodes = new int[]{addressHeader, p2shHeader}; } } } diff --git a/assets/src/main/java/bisq/asset/coins/Australiacash.java b/assets/src/main/java/bisq/asset/coins/Australiacash.java index d0dea1b7d87..f120ed5e79c 100644 --- a/assets/src/main/java/bisq/asset/coins/Australiacash.java +++ b/assets/src/main/java/bisq/asset/coins/Australiacash.java @@ -30,7 +30,6 @@ public static class AustraliacashParams extends NetworkParametersAdapter { public AustraliacashParams() { addressHeader = 23; p2shHeader = 5; - acceptableAddressCodes = new int[]{addressHeader, p2shHeader}; } } } diff --git a/assets/src/main/java/bisq/asset/coins/BitcoinRhodium.java b/assets/src/main/java/bisq/asset/coins/BitcoinRhodium.java index befb60f2055..f8276361628 100644 --- a/assets/src/main/java/bisq/asset/coins/BitcoinRhodium.java +++ b/assets/src/main/java/bisq/asset/coins/BitcoinRhodium.java @@ -32,7 +32,6 @@ public static class BitcoinRhodiumParams extends NetworkParametersAdapter { public BitcoinRhodiumParams() { addressHeader = 61; p2shHeader = 123; - acceptableAddressCodes = new int[]{addressHeader, p2shHeader}; } } } diff --git a/assets/src/main/java/bisq/asset/coins/Bitmark.java b/assets/src/main/java/bisq/asset/coins/Bitmark.java index c4cac96f857..8bcbe20bb54 100644 --- a/assets/src/main/java/bisq/asset/coins/Bitmark.java +++ b/assets/src/main/java/bisq/asset/coins/Bitmark.java @@ -27,7 +27,6 @@ public static class BitmarkParams extends NetworkParametersAdapter { public BitmarkParams() { addressHeader = 85; p2shHeader = 5; - acceptableAddressCodes = new int[]{addressHeader, p2shHeader}; } } diff --git a/assets/src/main/java/bisq/asset/coins/Chaucha.java b/assets/src/main/java/bisq/asset/coins/Chaucha.java index c26b1a2dcfa..0f307a719df 100644 --- a/assets/src/main/java/bisq/asset/coins/Chaucha.java +++ b/assets/src/main/java/bisq/asset/coins/Chaucha.java @@ -32,7 +32,6 @@ public static class ChauchaParams extends NetworkParametersAdapter { public ChauchaParams() { addressHeader = 88; p2shHeader = 50; - acceptableAddressCodes = new int[]{addressHeader, p2shHeader}; } } } diff --git a/assets/src/main/java/bisq/asset/coins/Credits.java b/assets/src/main/java/bisq/asset/coins/Credits.java index 1a64f4a391e..8e3224f6547 100644 --- a/assets/src/main/java/bisq/asset/coins/Credits.java +++ b/assets/src/main/java/bisq/asset/coins/Credits.java @@ -50,7 +50,6 @@ public static class CreditsParams extends NetworkParametersAdapter { public CreditsParams() { addressHeader = 28; p2shHeader = 5; - acceptableAddressCodes = new int[]{addressHeader, p2shHeader}; } } -} \ No newline at end of file +} diff --git a/assets/src/main/java/bisq/asset/coins/DSTRA.java b/assets/src/main/java/bisq/asset/coins/DSTRA.java index e7ec0e2ca3d..230dd01dc61 100644 --- a/assets/src/main/java/bisq/asset/coins/DSTRA.java +++ b/assets/src/main/java/bisq/asset/coins/DSTRA.java @@ -50,7 +50,6 @@ public static class DSTRAParams extends NetworkParametersAdapter { public DSTRAParams() { addressHeader = 30; p2shHeader = 33; - acceptableAddressCodes = new int[]{addressHeader, p2shHeader}; } } } diff --git a/assets/src/main/java/bisq/asset/coins/Dash.java b/assets/src/main/java/bisq/asset/coins/Dash.java index 754c8528b58..397b3d61117 100644 --- a/assets/src/main/java/bisq/asset/coins/Dash.java +++ b/assets/src/main/java/bisq/asset/coins/Dash.java @@ -30,7 +30,6 @@ public static class DashMainNetParams extends NetworkParametersAdapter { public DashMainNetParams() { this.addressHeader = 76; this.p2shHeader = 16; - this.acceptableAddressCodes = new int[]{this.addressHeader, this.p2shHeader}; } } } diff --git a/assets/src/main/java/bisq/asset/coins/DeepOnion.java b/assets/src/main/java/bisq/asset/coins/DeepOnion.java index 716d1b96dae..947388c06b1 100644 --- a/assets/src/main/java/bisq/asset/coins/DeepOnion.java +++ b/assets/src/main/java/bisq/asset/coins/DeepOnion.java @@ -48,7 +48,6 @@ public DeepOnionParams() { super(); addressHeader = 31; p2shHeader = 78; - acceptableAddressCodes = new int[]{addressHeader, p2shHeader}; } } } diff --git a/assets/src/main/java/bisq/asset/coins/Dextro.java b/assets/src/main/java/bisq/asset/coins/Dextro.java index 8f880c2bd25..350a9321055 100644 --- a/assets/src/main/java/bisq/asset/coins/Dextro.java +++ b/assets/src/main/java/bisq/asset/coins/Dextro.java @@ -51,7 +51,6 @@ public DextroParams() { super(); addressHeader = 30; p2shHeader = 90; - acceptableAddressCodes = new int[]{addressHeader, p2shHeader}; } } } diff --git a/assets/src/main/java/bisq/asset/coins/Dogecoin.java b/assets/src/main/java/bisq/asset/coins/Dogecoin.java index 40a500ea529..e9fedd28134 100644 --- a/assets/src/main/java/bisq/asset/coins/Dogecoin.java +++ b/assets/src/main/java/bisq/asset/coins/Dogecoin.java @@ -31,7 +31,6 @@ public static class DogecoinMainNetParams extends NetworkParametersAdapter { public DogecoinMainNetParams() { this.addressHeader = 30; this.p2shHeader = 22; - this.acceptableAddressCodes = new int[]{this.addressHeader, this.p2shHeader}; } } } diff --git a/assets/src/main/java/bisq/asset/coins/Doichain.java b/assets/src/main/java/bisq/asset/coins/Doichain.java index 9bf904cc713..f050cf632c6 100644 --- a/assets/src/main/java/bisq/asset/coins/Doichain.java +++ b/assets/src/main/java/bisq/asset/coins/Doichain.java @@ -31,7 +31,6 @@ public static class DoichainParams extends NetworkParametersAdapter { public DoichainParams() { addressHeader = 52; p2shHeader = 13; - acceptableAddressCodes = new int[]{addressHeader, p2shHeader}; } } } diff --git a/assets/src/main/java/bisq/asset/coins/Fujicoin.java b/assets/src/main/java/bisq/asset/coins/Fujicoin.java index 9e2b181e15e..c54f26a55ca 100644 --- a/assets/src/main/java/bisq/asset/coins/Fujicoin.java +++ b/assets/src/main/java/bisq/asset/coins/Fujicoin.java @@ -30,7 +30,6 @@ public static class FujicoinParams extends NetworkParametersAdapter { public FujicoinParams() { addressHeader = 36; p2shHeader = 16; - acceptableAddressCodes = new int[]{addressHeader, p2shHeader}; } } } diff --git a/assets/src/main/java/bisq/asset/coins/Galilel.java b/assets/src/main/java/bisq/asset/coins/Galilel.java index 138e965330d..9dbabc4b8ca 100644 --- a/assets/src/main/java/bisq/asset/coins/Galilel.java +++ b/assets/src/main/java/bisq/asset/coins/Galilel.java @@ -30,7 +30,6 @@ public static class GalilelMainNetParams extends NetworkParametersAdapter { public GalilelMainNetParams() { this.addressHeader = 68; this.p2shHeader = 16; - this.acceptableAddressCodes = new int[]{this.addressHeader, this.p2shHeader}; } } } diff --git a/assets/src/main/java/bisq/asset/coins/GambleCoin.java b/assets/src/main/java/bisq/asset/coins/GambleCoin.java index a199219d940..27447cf9a06 100644 --- a/assets/src/main/java/bisq/asset/coins/GambleCoin.java +++ b/assets/src/main/java/bisq/asset/coins/GambleCoin.java @@ -51,7 +51,6 @@ public GambleCoinParams() { super(); addressHeader = 28; p2shHeader = 18; - acceptableAddressCodes = new int[]{addressHeader, p2shHeader}; } } } diff --git a/assets/src/main/java/bisq/asset/coins/Hatch.java b/assets/src/main/java/bisq/asset/coins/Hatch.java index bbff61765bf..0d2d5b3b97e 100644 --- a/assets/src/main/java/bisq/asset/coins/Hatch.java +++ b/assets/src/main/java/bisq/asset/coins/Hatch.java @@ -30,7 +30,6 @@ public static class HatchMainNetParams extends NetworkParametersAdapter { public HatchMainNetParams() { this.addressHeader = 76; this.p2shHeader = 16; - this.acceptableAddressCodes = new int[]{this.addressHeader, this.p2shHeader}; } } } diff --git a/assets/src/main/java/bisq/asset/coins/Helium.java b/assets/src/main/java/bisq/asset/coins/Helium.java index cec17a9f7ba..592c6cfaa1c 100644 --- a/assets/src/main/java/bisq/asset/coins/Helium.java +++ b/assets/src/main/java/bisq/asset/coins/Helium.java @@ -33,7 +33,6 @@ public static class HeliumParams extends NetworkParametersAdapter { public HeliumParams() { addressHeader = 63; p2shHeader = 5; - acceptableAddressCodes = new int[]{addressHeader, p2shHeader}; } } } diff --git a/assets/src/main/java/bisq/asset/coins/IdaPay.java b/assets/src/main/java/bisq/asset/coins/IdaPay.java index 84000ff023b..c205b2d7e5d 100644 --- a/assets/src/main/java/bisq/asset/coins/IdaPay.java +++ b/assets/src/main/java/bisq/asset/coins/IdaPay.java @@ -51,7 +51,6 @@ public IdaPayParams() { super(); addressHeader = 29; p2shHeader = 36; - acceptableAddressCodes = new int[]{addressHeader, p2shHeader}; } } } diff --git a/assets/src/main/java/bisq/asset/coins/Kekcoin.java b/assets/src/main/java/bisq/asset/coins/Kekcoin.java index 33f5bc2107e..b7927609d72 100644 --- a/assets/src/main/java/bisq/asset/coins/Kekcoin.java +++ b/assets/src/main/java/bisq/asset/coins/Kekcoin.java @@ -34,7 +34,6 @@ public KekcoinParams() { super(); addressHeader = 45; p2shHeader = 88; - acceptableAddressCodes = new int[]{addressHeader, p2shHeader}; } } -} \ No newline at end of file +} diff --git a/assets/src/main/java/bisq/asset/coins/Litecoin.java b/assets/src/main/java/bisq/asset/coins/Litecoin.java index 57b61a3cb50..6580f851dd9 100644 --- a/assets/src/main/java/bisq/asset/coins/Litecoin.java +++ b/assets/src/main/java/bisq/asset/coins/Litecoin.java @@ -30,7 +30,6 @@ public static class LitecoinMainNetParams extends NetworkParametersAdapter { public LitecoinMainNetParams() { this.addressHeader = 48; this.p2shHeader = 5; - this.acceptableAddressCodes = new int[]{this.addressHeader, this.p2shHeader}; } } } diff --git a/assets/src/main/java/bisq/asset/coins/LitecoinPlus.java b/assets/src/main/java/bisq/asset/coins/LitecoinPlus.java index aaf8d669b96..c5ce3070c1f 100644 --- a/assets/src/main/java/bisq/asset/coins/LitecoinPlus.java +++ b/assets/src/main/java/bisq/asset/coins/LitecoinPlus.java @@ -31,7 +31,6 @@ public static class LitecoinPlusMainNetParams extends NetworkParametersAdapter { public LitecoinPlusMainNetParams() { this.addressHeader = 75; this.p2shHeader = 8; - this.acceptableAddressCodes = new int[]{this.addressHeader, this.p2shHeader}; } } } diff --git a/assets/src/main/java/bisq/asset/coins/Lytix.java b/assets/src/main/java/bisq/asset/coins/Lytix.java index d9a0de079b0..629a47f3d46 100644 --- a/assets/src/main/java/bisq/asset/coins/Lytix.java +++ b/assets/src/main/java/bisq/asset/coins/Lytix.java @@ -33,7 +33,6 @@ public static class LytixParams extends NetworkParametersAdapter { public LytixParams() { addressHeader = 19; p2shHeader = 11; - acceptableAddressCodes = new int[]{addressHeader, p2shHeader}; } } } diff --git a/assets/src/main/java/bisq/asset/coins/MobitGlobal.java b/assets/src/main/java/bisq/asset/coins/MobitGlobal.java index c4e1eb86d20..6b2bfbff129 100644 --- a/assets/src/main/java/bisq/asset/coins/MobitGlobal.java +++ b/assets/src/main/java/bisq/asset/coins/MobitGlobal.java @@ -50,7 +50,6 @@ public static class MobitGlobalParams extends NetworkParametersAdapter { public MobitGlobalParams() { addressHeader = 50; p2shHeader = 110; - acceptableAddressCodes = new int[]{addressHeader, p2shHeader}; } } } diff --git a/assets/src/main/java/bisq/asset/coins/MonetaryUnit.java b/assets/src/main/java/bisq/asset/coins/MonetaryUnit.java index b1cd79a9954..4055768af34 100644 --- a/assets/src/main/java/bisq/asset/coins/MonetaryUnit.java +++ b/assets/src/main/java/bisq/asset/coins/MonetaryUnit.java @@ -50,7 +50,6 @@ public static class MonetaryUnitParams extends NetworkParametersAdapter { public MonetaryUnitParams() { addressHeader = 16; p2shHeader = 76; - acceptableAddressCodes = new int[]{addressHeader, p2shHeader}; } } } diff --git a/assets/src/main/java/bisq/asset/coins/Navcoin.java b/assets/src/main/java/bisq/asset/coins/Navcoin.java index 31c07866573..64275556369 100644 --- a/assets/src/main/java/bisq/asset/coins/Navcoin.java +++ b/assets/src/main/java/bisq/asset/coins/Navcoin.java @@ -30,7 +30,6 @@ public static class NavcoinParams extends NetworkParametersAdapter { public NavcoinParams() { this.addressHeader = 53; this.p2shHeader = 85; - this.acceptableAddressCodes = new int[]{this.addressHeader, this.p2shHeader}; } } } diff --git a/assets/src/main/java/bisq/asset/coins/Neos.java b/assets/src/main/java/bisq/asset/coins/Neos.java index 86f9b6ea6d8..1585e5717f7 100644 --- a/assets/src/main/java/bisq/asset/coins/Neos.java +++ b/assets/src/main/java/bisq/asset/coins/Neos.java @@ -50,7 +50,6 @@ public static class NeosParams extends NetworkParametersAdapter { public NeosParams() { addressHeader = 53; p2shHeader = 5; - acceptableAddressCodes = new int[]{addressHeader, p2shHeader}; } } } diff --git a/assets/src/main/java/bisq/asset/coins/PIVX.java b/assets/src/main/java/bisq/asset/coins/PIVX.java index 12bd6a91118..cfde4d85941 100644 --- a/assets/src/main/java/bisq/asset/coins/PIVX.java +++ b/assets/src/main/java/bisq/asset/coins/PIVX.java @@ -50,7 +50,6 @@ public static class PIVXParams extends NetworkParametersAdapter { public PIVXParams() { addressHeader = 30; p2shHeader = 13; - acceptableAddressCodes = new int[]{addressHeader, p2shHeader}; } } } diff --git a/assets/src/main/java/bisq/asset/coins/PZDC.java b/assets/src/main/java/bisq/asset/coins/PZDC.java index f91c9a623dc..18f40b9b911 100644 --- a/assets/src/main/java/bisq/asset/coins/PZDC.java +++ b/assets/src/main/java/bisq/asset/coins/PZDC.java @@ -50,7 +50,6 @@ public static class PZDCParams extends NetworkParametersAdapter { public PZDCParams() { addressHeader = 55; p2shHeader = 13; - acceptableAddressCodes = new int[]{addressHeader, p2shHeader}; } } } diff --git a/assets/src/main/java/bisq/asset/coins/Pinkcoin.java b/assets/src/main/java/bisq/asset/coins/Pinkcoin.java index b27bece164a..0792bd0857d 100644 --- a/assets/src/main/java/bisq/asset/coins/Pinkcoin.java +++ b/assets/src/main/java/bisq/asset/coins/Pinkcoin.java @@ -33,7 +33,6 @@ public static class PinkcoinParams extends NetworkParametersAdapter { public PinkcoinParams() { addressHeader = 3; p2shHeader = 28; - acceptableAddressCodes = new int[]{addressHeader, p2shHeader}; } } } diff --git a/assets/src/main/java/bisq/asset/coins/QMCoin.java b/assets/src/main/java/bisq/asset/coins/QMCoin.java index 984ba4cb218..75f8deade5a 100644 --- a/assets/src/main/java/bisq/asset/coins/QMCoin.java +++ b/assets/src/main/java/bisq/asset/coins/QMCoin.java @@ -50,7 +50,6 @@ public static class QMCoinParams extends NetworkParametersAdapter { public QMCoinParams() { addressHeader = 58; p2shHeader = 120; - acceptableAddressCodes = new int[]{addressHeader, p2shHeader}; } } } diff --git a/assets/src/main/java/bisq/asset/coins/Qbase.java b/assets/src/main/java/bisq/asset/coins/Qbase.java index 94d70f43043..2d076a74dc1 100644 --- a/assets/src/main/java/bisq/asset/coins/Qbase.java +++ b/assets/src/main/java/bisq/asset/coins/Qbase.java @@ -32,7 +32,6 @@ public static class QbaseParams extends NetworkParametersAdapter { public QbaseParams() { addressHeader = 25; p2shHeader = 5; - acceptableAddressCodes = new int[]{addressHeader, p2shHeader}; } } } diff --git a/assets/src/main/java/bisq/asset/coins/Radium.java b/assets/src/main/java/bisq/asset/coins/Radium.java index aed79c63033..8c59a1258c0 100644 --- a/assets/src/main/java/bisq/asset/coins/Radium.java +++ b/assets/src/main/java/bisq/asset/coins/Radium.java @@ -34,7 +34,6 @@ public RadiumParams() { super(); addressHeader = 76; p2shHeader = 58; - acceptableAddressCodes = new int[]{addressHeader, p2shHeader}; } } -} \ No newline at end of file +} diff --git a/assets/src/main/java/bisq/asset/coins/SUB1X.java b/assets/src/main/java/bisq/asset/coins/SUB1X.java index 14daac5be06..9bcb32386a8 100644 --- a/assets/src/main/java/bisq/asset/coins/SUB1X.java +++ b/assets/src/main/java/bisq/asset/coins/SUB1X.java @@ -50,7 +50,6 @@ public static class SUB1XParams extends NetworkParametersAdapter { public SUB1XParams() { addressHeader = 80; p2shHeader = 13; - acceptableAddressCodes = new int[]{addressHeader, p2shHeader}; } } } diff --git a/assets/src/main/java/bisq/asset/coins/Spectrecoin.java b/assets/src/main/java/bisq/asset/coins/Spectrecoin.java index ee9f7a763c9..404c3512082 100644 --- a/assets/src/main/java/bisq/asset/coins/Spectrecoin.java +++ b/assets/src/main/java/bisq/asset/coins/Spectrecoin.java @@ -33,7 +33,6 @@ public static class SpectrecoinParams extends NetworkParametersAdapter { public SpectrecoinParams() { addressHeader = 63; p2shHeader = 136; - acceptableAddressCodes = new int[]{addressHeader, p2shHeader}; } } } diff --git a/assets/src/main/java/bisq/asset/coins/UnitedCommunityCoin.java b/assets/src/main/java/bisq/asset/coins/UnitedCommunityCoin.java index 9d893980e87..dba97a2c550 100644 --- a/assets/src/main/java/bisq/asset/coins/UnitedCommunityCoin.java +++ b/assets/src/main/java/bisq/asset/coins/UnitedCommunityCoin.java @@ -51,7 +51,6 @@ public UnitedCommunityCoinParams() { super(); addressHeader = 68; p2shHeader = 18; - acceptableAddressCodes = new int[]{addressHeader, p2shHeader}; } } } diff --git a/assets/src/main/java/bisq/asset/coins/Veil.java b/assets/src/main/java/bisq/asset/coins/Veil.java index 792cba487ab..8e9e5ee2f9a 100644 --- a/assets/src/main/java/bisq/asset/coins/Veil.java +++ b/assets/src/main/java/bisq/asset/coins/Veil.java @@ -50,7 +50,6 @@ public static class VeilParams extends NetworkParametersAdapter { public VeilParams() { addressHeader = 70; p2shHeader = 5; - acceptableAddressCodes = new int[]{addressHeader, p2shHeader}; } } } From 0008752059856ef137aa65cd40a0c7823e397004 Mon Sep 17 00:00:00 2001 From: Oscar Guindzberg Date: Tue, 9 Apr 2019 12:40:48 -0300 Subject: [PATCH 10/30] bitcoinj 0.15: ScriptException moved to another package. --- core/src/main/java/bisq/core/btc/wallet/BsqWalletService.java | 2 +- core/src/main/java/bisq/core/btc/wallet/WalletService.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/core/src/main/java/bisq/core/btc/wallet/BsqWalletService.java b/core/src/main/java/bisq/core/btc/wallet/BsqWalletService.java index ed3de95eb7d..cb14c05e67c 100644 --- a/core/src/main/java/bisq/core/btc/wallet/BsqWalletService.java +++ b/core/src/main/java/bisq/core/btc/wallet/BsqWalletService.java @@ -42,7 +42,7 @@ import org.bitcoinj.core.ECKey; import org.bitcoinj.core.InsufficientMoneyException; import org.bitcoinj.core.NetworkParameters; -import org.bitcoinj.core.ScriptException; +import org.bitcoinj.script.ScriptException; import org.bitcoinj.core.Transaction; import org.bitcoinj.core.TransactionConfidence; import org.bitcoinj.core.TransactionInput; diff --git a/core/src/main/java/bisq/core/btc/wallet/WalletService.java b/core/src/main/java/bisq/core/btc/wallet/WalletService.java index 9f4ad0559a6..530793b526a 100644 --- a/core/src/main/java/bisq/core/btc/wallet/WalletService.java +++ b/core/src/main/java/bisq/core/btc/wallet/WalletService.java @@ -37,7 +37,7 @@ import org.bitcoinj.core.ECKey; import org.bitcoinj.core.InsufficientMoneyException; import org.bitcoinj.core.NetworkParameters; -import org.bitcoinj.core.ScriptException; +import org.bitcoinj.script.ScriptException; import org.bitcoinj.core.Sha256Hash; import org.bitcoinj.core.Transaction; import org.bitcoinj.core.TransactionConfidence; From efd0e4b4b9fe35eae86e137771c2f778cbc75b31 Mon Sep 17 00:00:00 2001 From: Oscar Guindzberg Date: Tue, 9 Apr 2019 15:50:38 -0300 Subject: [PATCH 11/30] bitcoinj 0.15: WalletEventListener was replaced by more granular listeners. --- .../core/btc/wallet/BsqWalletService.java | 76 +++++++--------- .../core/btc/wallet/BtcWalletService.java | 5 +- .../bisq/core/btc/wallet/WalletService.java | 81 ++++++++++++++--- .../funds/transactions/TransactionsView.java | 90 ++++++++++--------- 4 files changed, 155 insertions(+), 97 deletions(-) diff --git a/core/src/main/java/bisq/core/btc/wallet/BsqWalletService.java b/core/src/main/java/bisq/core/btc/wallet/BsqWalletService.java index cb14c05e67c..4c8fe02ffe7 100644 --- a/core/src/main/java/bisq/core/btc/wallet/BsqWalletService.java +++ b/core/src/main/java/bisq/core/btc/wallet/BsqWalletService.java @@ -42,6 +42,7 @@ import org.bitcoinj.core.ECKey; import org.bitcoinj.core.InsufficientMoneyException; import org.bitcoinj.core.NetworkParameters; +import org.bitcoinj.core.listeners.TransactionConfidenceEventListener; import org.bitcoinj.script.ScriptException; import org.bitcoinj.core.Transaction; import org.bitcoinj.core.TransactionConfidence; @@ -53,7 +54,12 @@ import org.bitcoinj.wallet.CoinSelector; import org.bitcoinj.wallet.SendRequest; import org.bitcoinj.wallet.Wallet; -import org.bitcoinj.wallet.listeners.AbstractWalletEventListener; +import org.bitcoinj.wallet.listeners.KeyChainEventListener; +import org.bitcoinj.wallet.listeners.ScriptsChangeEventListener; +import org.bitcoinj.wallet.listeners.WalletChangeEventListener; +import org.bitcoinj.wallet.listeners.WalletCoinsReceivedEventListener; +import org.bitcoinj.wallet.listeners.WalletCoinsSentEventListener; +import org.bitcoinj.wallet.listeners.WalletReorganizeEventListener; import javax.inject.Inject; @@ -129,48 +135,34 @@ public BsqWalletService(WalletsSetup walletsSetup, wallet = walletsSetup.getBsqWallet(); if (wallet != null) { wallet.setCoinSelector(bsqCoinSelector); - wallet.addEventListener(walletEventListener); - - //noinspection deprecation - wallet.addEventListener(new AbstractWalletEventListener() { - @Override - public void onCoinsReceived(Wallet wallet, Transaction tx, Coin prevBalance, Coin newBalance) { - updateBsqWalletTransactions(); - } - - @Override - public void onCoinsSent(Wallet wallet, Transaction tx, Coin prevBalance, Coin newBalance) { - updateBsqWalletTransactions(); - } - - @Override - public void onReorganize(Wallet wallet) { - log.warn("onReorganize "); - updateBsqWalletTransactions(); - unconfirmedBsqChangeOutputListService.onReorganize(); - } - - @Override - public void onTransactionConfidenceChanged(Wallet wallet, Transaction tx) { - updateBsqWalletTransactions(); - unconfirmedBsqChangeOutputListService.onTransactionConfidenceChanged(tx); - } - - @Override - public void onKeysAdded(List keys) { - updateBsqWalletTransactions(); - } - - @Override - public void onScriptsChanged(Wallet wallet, List