From 14e605790f2885c552a43dc5d80d4258fff68f48 Mon Sep 17 00:00:00 2001 From: Oscar Guindzberg Date: Thu, 3 Jan 2019 16:15:36 -0300 Subject: [PATCH 1/3] Use bitcoinj 0.14.7 (commit 3e7ff3a) --- build.gradle | 2 +- gradle/witness/gradle-witness.gradle | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/build.gradle b/build.gradle index 0bd78f02d8b..a61bd3c7df9 100644 --- a/build.gradle +++ b/build.gradle @@ -33,7 +33,7 @@ configure(subprojects) { jmockitVersion = '1.42' joptVersion = '5.0.3' langVersion = '3.4' - bitcoinjVersion = 'cd30ad5b' + bitcoinjVersion = '3e7ff3a' logbackVersion = '1.1.10' lombokVersion = '1.18.2' mockitoVersion = '2.21.0' diff --git a/gradle/witness/gradle-witness.gradle b/gradle/witness/gradle-witness.gradle index 258b9316ccf..879781d4fd2 100644 --- a/gradle/witness/gradle-witness.gradle +++ b/gradle/witness/gradle-witness.gradle @@ -37,7 +37,7 @@ dependencyVerification { 'com.googlecode.json-simple:json-simple:4e69696892b88b41c55d49ab2fdcc21eead92bf54acc588c0050596c3b75199c', 'org.springframework:spring-core:c451e8417adb2ffb2445636da5e44a2f59307c4100037a1fe387c3fba4f29b52', 'ch.qos.logback:logback-classic:e66efc674e94837344bc5b748ff510c37a44eeff86cbfdbf9e714ef2eb374013', - 'com.github.bisq-network.bitcoinj:bitcoinj-core:d148d9577cf96540f7f5367011f7626ff9c9f148f0bf903b541740d480652969', + 'com.github.bisq-network.bitcoinj:bitcoinj-core:15b2ac7e7a3af442f9d734d05a872586e7cd70c451c1bbaaf152830fc3421ec8', 'org.slf4j:slf4j-api:3a4cd4969015f3beb4b5b4d81dbafc01765fb60b8a439955ca64d8476fef553e', 'ch.qos.logback:logback-core:4cd46fa17d77057b39160058df2f21ebbc2aded51d0edcc25d2c1cecc042a005', 'com.google.code.findbugs:jsr305:766ad2a0783f2687962c8ad74ceecc38a28b9f72a2d085ee438b7813e928d0c7', From 6c09a671a5c658e622aa360357b553556047eeb9 Mon Sep 17 00:00:00 2001 From: Oscar Guindzberg Date: Thu, 3 Jan 2019 17:23:20 -0300 Subject: [PATCH 2/3] Exclude bitcoinj dependencies in conflict with bisq dependency version --- build.gradle | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/build.gradle b/build.gradle index a61bd3c7df9..c075d88f9f4 100644 --- a/build.gradle +++ b/build.gradle @@ -132,8 +132,13 @@ configure([project(':desktop'), configure(project(':assets')) { dependencies { compile("com.github.bisq-network.bitcoinj:bitcoinj-core:$bitcoinjVersion") { + exclude(module: 'jsr305') + exclude(module: 'slf4j-api') + exclude(module: 'guava') exclude(module: 'protobuf-java') } + compile 'com.google.guava:guava:20.0' + compile "org.slf4j:slf4j-api:$slf4jVersion" compile "commons-codec:commons-codec:$codecVersion" compile "org.apache.commons:commons-lang3:$langVersion" compile "org.bouncycastle:bcpg-jdk15on:$bcVersion" From 3476765a9020ee4090371683e9684c3ad5cbb2d3 Mon Sep 17 00:00:00 2001 From: Oscar Guindzberg Date: Tue, 22 Jan 2019 19:19:10 -0300 Subject: [PATCH 3/3] Use Transaction.getIncludedInBestChainAt() --- core/src/main/java/bisq/core/btc/wallet/WalletService.java | 1 + core/src/main/java/bisq/core/trade/Trade.java | 3 ++- .../main/java/bisq/desktop/main/dao/wallet/tx/BsqTxView.java | 3 ++- .../desktop/main/funds/transactions/TransactionsListItem.java | 4 ++-- 4 files changed, 7 insertions(+), 4 deletions(-) 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 43b77805ad3..b5d321fdb16 100644 --- a/core/src/main/java/bisq/core/btc/wallet/WalletService.java +++ b/core/src/main/java/bisq/core/btc/wallet/WalletService.java @@ -592,6 +592,7 @@ public boolean isEncrypted() { } public List getRecentTransactions(int numTransactions, boolean includeDead) { + // Returns a list ordered by tx.getUpdateTime() desc return wallet.getRecentTransactions(numTransactions, includeDead); } diff --git a/core/src/main/java/bisq/core/trade/Trade.java b/core/src/main/java/bisq/core/trade/Trade.java index ef9e7438850..136317b658d 100644 --- a/core/src/main/java/bisq/core/trade/Trade.java +++ b/core/src/main/java/bisq/core/trade/Trade.java @@ -752,7 +752,8 @@ private long getTradeStartTime() { if (depositTx != null && getTakeOfferDate() != null) { if (depositTx.getConfidence().getDepthInBlocks() > 0) { final long tradeTime = getTakeOfferDate().getTime(); - long blockTime = depositTx.getUpdateTime().getTime(); + // Use tx.getIncludedInBestChainAt() when available, otherwise use tx.getUpdateTime() + long blockTime = depositTx.getIncludedInBestChainAt() != null ? depositTx.getIncludedInBestChainAt().getTime() : depositTx.getUpdateTime().getTime(); // If block date is in future (Date in Bitcoin blocks can be off by +/- 2 hours) we use our current date. // If block date is earlier than our trade date we use our trade date. if (blockTime > now) diff --git a/desktop/src/main/java/bisq/desktop/main/dao/wallet/tx/BsqTxView.java b/desktop/src/main/java/bisq/desktop/main/dao/wallet/tx/BsqTxView.java index 6b7ca5fabb0..b73a1df389d 100644 --- a/desktop/src/main/java/bisq/desktop/main/dao/wallet/tx/BsqTxView.java +++ b/desktop/src/main/java/bisq/desktop/main/dao/wallet/tx/BsqTxView.java @@ -265,7 +265,8 @@ private void updateList() { bsqWalletService, btcWalletService, daoFacade, - transaction.getUpdateTime(), + // Use tx.getIncludedInBestChainAt() when available, otherwise use tx.getUpdateTime() + transaction.getIncludedInBestChainAt() != null ? transaction.getIncludedInBestChainAt() : transaction.getUpdateTime(), bsqFormatter); }) .collect(Collectors.toList()); diff --git a/desktop/src/main/java/bisq/desktop/main/funds/transactions/TransactionsListItem.java b/desktop/src/main/java/bisq/desktop/main/funds/transactions/TransactionsListItem.java index 46f595fd1c9..4405a8e28d1 100644 --- a/desktop/src/main/java/bisq/desktop/main/funds/transactions/TransactionsListItem.java +++ b/desktop/src/main/java/bisq/desktop/main/funds/transactions/TransactionsListItem.java @@ -221,8 +221,8 @@ else if (!txFeeForBsqPayment) else if (details.isEmpty()) details = Res.get("funds.tx.txFeePaymentForBsqTx"); } - - date = transaction.getUpdateTime(); + // Use tx.getIncludedInBestChainAt() when available, otherwise use tx.getUpdateTime() + date = transaction.getIncludedInBestChainAt() != null ? transaction.getIncludedInBestChainAt() : transaction.getUpdateTime(); dateString = formatter.formatDateTime(date); }