Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release/v1.4.0 and v1.4.1 #4655

Merged
merged 143 commits into from
Oct 20, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
143 commits
Select commit Hold shift + click to select a range
5294820
Bump version number for v1.4.0
ripcurlx Oct 8, 2020
2d06946
Update translations for v1.4.0
ripcurlx Oct 8, 2020
f13a7b1
Create a P2WPKH keychain for new btc wallets
oscarguindzberg Sep 14, 2020
cd28660
Add a P2WPKH keychain for existing wallets
oscarguindzberg Sep 14, 2020
ced357c
AddressEntry: Add boolean segwit flag
oscarguindzberg Sep 14, 2020
e85c66b
Stop using LegacyAddress for btc addresses
oscarguindzberg Sep 14, 2020
0c7f345
Fix log msg in BtcCoinSelector
oscarguindzberg Sep 14, 2020
0f4c66f
Comment out segwit BSQ account path
oscarguindzberg Sep 29, 2020
2551571
TradeWalletService: adapt to segwit wallet
oscarguindzberg Sep 29, 2020
d8b7557
WalletService: adapt to segwit wallet
oscarguindzberg Sep 29, 2020
a370848
New AddressEntry: use different script types
oscarguindzberg Sep 25, 2020
a9cc28f
AddressEntryList: arbitrator entry use P2PKH
oscarguindzberg Sep 25, 2020
f9f5d92
Add segwit/legacy checbox for address creation
oscarguindzberg Sep 25, 2020
1f3c585
Serialize tx without segwit
oscarguindzberg Sep 28, 2020
58afc00
Don't create an extra address at startup
oscarguindzberg Sep 28, 2020
e2f74f0
Don't create a wallet address when not needed
oscarguindzberg Sep 28, 2020
d1aeedd
Remove unused WalletService.findKeyFromPubKeyHash()
oscarguindzberg Sep 24, 2020
78a2a43
Remove unused import
oscarguindzberg Sep 14, 2020
01455d2
Enable reusing unused AVAILABLE entries
oscarguindzberg Oct 1, 2020
4a2c0ad
Make codacy happy
oscarguindzberg Oct 1, 2020
86ddd06
Validate AddressEntry.segwit
oscarguindzberg Oct 5, 2020
b9e404f
Make it clear segwit is not used for the trade protocol yet.
oscarguindzberg Oct 5, 2020
5524ba3
BtcWalletService.getFreshAddressEntry(): code clean up
oscarguindzberg Oct 5, 2020
d1aaf3e
Construct dummy outputs with LegacyAddress
oscarguindzberg Oct 5, 2020
3554e19
setWitness(): Code clean up
oscarguindzberg Oct 5, 2020
499d7b7
Use try-with-resources
oscarguindzberg Oct 5, 2020
1d82c01
Improve error handling for P2WPKH
oscarguindzberg Oct 5, 2020
694446c
Switch back to LegacyAddress for fee estimation
oscarguindzberg Oct 5, 2020
a747e83
Fix add segwit keychain for encrypted wallet
oscarguindzberg Oct 7, 2020
417daf5
Use bitcoinj 0.15.8 (commit a733034)
oscarguindzberg Oct 8, 2020
87da2ae
Do a backup of the wallet before segwit migration
oscarguindzberg Oct 8, 2020
261e0ec
Check migratedWalletToSegwit is true
oscarguindzberg Oct 8, 2020
35e0c34
Merge pull request #4568 from oscarguindzberg/segwitWallet
sqrrm Oct 8, 2020
9404e8f
Add NO_ADDRESS_PRE_FIX capability.
chimp1984 Oct 7, 2020
e73a4b4
Cleanups
chimp1984 Oct 7, 2020
6f7dfcf
Make onRemoved default in interface
chimp1984 Oct 7, 2020
40f9cfb
Add methods for getting peers capabilities
chimp1984 Oct 7, 2020
8aec306
Remove verification for address prefix
chimp1984 Oct 7, 2020
9821dd6
Clear capabilitiesListeners at shutdown
chimp1984 Oct 7, 2020
17974f3
Refactor: move SupportedCapabilitiesMessage handling code out to a me…
chimp1984 Oct 7, 2020
1c07be0
Use only node address for equals and hashcode
chimp1984 Oct 7, 2020
bf659a1
Pass supportedCapabilities to PeerManager. Not further processed yet,…
chimp1984 Oct 7, 2020
2523c2e
Use getSingleThreadListeningExecutor, cleanups
chimp1984 Oct 7, 2020
765f9ea
Apply code inspection suggestions
chimp1984 Oct 7, 2020
186a9d6
Add findPeersCapabilities method
chimp1984 Oct 7, 2020
7af16d7
Add getDateAsLong method, add setter for capabilities
chimp1984 Oct 7, 2020
25bfe2d
Add findPeersCapabilities method
chimp1984 Oct 7, 2020
2552675
Replace persistedPeers with peerList
chimp1984 Oct 7, 2020
bf674ea
Use getPersistedPeers for peerList.getList() calls
chimp1984 Oct 7, 2020
cf06930
Update common/src/main/java/bisq/common/app/Capability.java
chimp1984 Oct 7, 2020
983f610
Update p2p/src/main/java/bisq/network/p2p/network/Connection.java
chimp1984 Oct 7, 2020
31e7e26
Fix incorrect handling of decryptedEntries size
chimp1984 Oct 7, 2020
4575516
Refactor: Return early
chimp1984 Oct 7, 2020
ed960ab
Refactor: Rearrange code, remove unused methods, renamings (no functi…
chimp1984 Oct 7, 2020
0686079
Refactor: Rename method
chimp1984 Oct 7, 2020
31ce5cc
Use connection.getPeersNodeAddressOptional().isPresent() instead of c…
chimp1984 Oct 7, 2020
cfda0af
Fix tests
chimp1984 Oct 8, 2020
351db88
Use a hashset instead of list to avoid duplicates. Filter out my own …
chimp1984 Oct 8, 2020
2fd0104
Decrease failedConnectionAttempts onConnection
chimp1984 Oct 8, 2020
f36a173
Fix incorrect collection used in == 1 check
chimp1984 Oct 8, 2020
b748bff
Add isPresent check
chimp1984 Oct 8, 2020
c7f23e8
Do not log size as we don't want to call potentially expensive toProt…
chimp1984 Oct 8, 2020
f53290b
Copy peers in a new hashset to avoid concurrent modification exc at s…
chimp1984 Oct 8, 2020
447235c
Dont reassign param
chimp1984 Oct 8, 2020
c88bc1c
Use custom class MailboxItem instead of Tuple
chimp1984 Oct 8, 2020
c8feef1
Apply code review suggestions
chimp1984 Oct 8, 2020
4f685f8
When updating the capability from a reported peer we check if the rep…
chimp1984 Oct 8, 2020
6e3fdbc
Apply codacy suggestions
chimp1984 Oct 8, 2020
00bed02
Add TradeStatistics3 and related classes
chimp1984 Oct 5, 2020
406bcfb
Remove PublishTradeStatistics from buyer protocol
chimp1984 Oct 5, 2020
b75aa67
Refactor: Move class
chimp1984 Oct 5, 2020
a522d0a
Refactor: Rename class
chimp1984 Oct 5, 2020
b2665bd
let seller publish trade statistics only if peer is updated user. If …
chimp1984 Oct 5, 2020
6d43c09
Delete TradeStatistics (version 1)
chimp1984 Oct 5, 2020
9820751
We "hack" TradeStatistics2StorageService to fulfill our needs:
chimp1984 Oct 5, 2020
c4a4c87
Apply TradeStatistics3 to TradeStatisticsManager and some related cla…
chimp1984 Oct 5, 2020
52be126
Apply TradeStatistics3 to client classes
chimp1984 Oct 5, 2020
0e70a99
Adjust tests, remove tests which do not make sense anymore
chimp1984 Oct 5, 2020
6766835
Use TradeStatistics3 in protobuf file
chimp1984 Oct 5, 2020
b14266d
Remove resource file
chimp1984 Oct 5, 2020
9016cb6
Prune mediator and refund agent entries for all entries beside the la…
chimp1984 Oct 6, 2020
f56fe42
Add injector.getInstance(TradeStatisticsConverter.class) to BisqExecu…
chimp1984 Oct 6, 2020
fa374b9
Do conversion in a thread to not block UI thread. takes about 4 secon…
chimp1984 Oct 6, 2020
213050c
Add filter for excluding null objects
chimp1984 Oct 6, 2020
17f4ae2
Add check that size is > LOOK_BACK_RANGE
chimp1984 Oct 6, 2020
e95ab2a
Add resource file for 1.4.0 (should be updated at release time)
chimp1984 Oct 6, 2020
58d2f1b
Apply codacy suggestions
chimp1984 Oct 8, 2020
197d8c1
Remove copy&past mistake
chimp1984 Oct 8, 2020
18a27e9
Republish trade statistics from seller side if peer capability is kno…
chimp1984 Oct 8, 2020
68a10cf
Remove comment line
chimp1984 Oct 8, 2020
66740b7
Remove unused variable
chimp1984 Oct 9, 2020
39c8ade
Cleanups: Remove outdated TODOs, fix typos
chimp1984 Oct 9, 2020
352d954
Merge pull request #4610 from chimp1984/remove-address-prefix
ripcurlx Oct 9, 2020
3687a03
Merge pull request #4611 from chimp1984/new-trade-statistics
ripcurlx Oct 9, 2020
4d2f1b5
Set memo to tx after tx creation and not on broadcast success, as bro…
chimp1984 Oct 11, 2020
db10aa3
Only show xmr auto conf label for sell offers
chimp1984 Oct 11, 2020
1f0590d
Use hash at conversion also for local data to avoid duplicates.
chimp1984 Oct 11, 2020
8e93e4b
Use aesKey in Wallet.toString()
oscarguindzberg Oct 11, 2020
2dc7662
Merge pull request #4627 from oscarguindzberg/fixWalletToString
ripcurlx Oct 12, 2020
1eb730a
Merge pull request #4626 from chimp1984/avoid-duplicate-trade-stats
ripcurlx Oct 12, 2020
ee14884
Merge pull request #4625 from chimp1984/only-showXmrAutoConf-for-sell…
ripcurlx Oct 12, 2020
41b2e6a
Merge pull request #4619 from chimp1984/fix-memo-bug-issue-4616
ripcurlx Oct 12, 2020
1c0655e
Stop PeerGroup only if running
oscarguindzberg Oct 12, 2020
0d46906
Change write json files to disk strategy
chimp1984 Oct 13, 2020
88f9eee
Merge pull request #4635 from chimp1984/fix-performance-issues-at-dum…
ripcurlx Oct 13, 2020
e5dd316
Merge pull request #4631 from oscarguindzberg/fixPeerGroupStop
ripcurlx Oct 13, 2020
3b4d109
Fix bug at mediation with old client
chimp1984 Oct 13, 2020
129eaa7
Merge pull request #4638 from chimp1984/fix-mediation-bug
sqrrm Oct 13, 2020
b719302
Exclude depositTxId as it seems that leads to
chimp1984 Oct 13, 2020
30c77aa
Update resource file.
chimp1984 Oct 13, 2020
be08c86
Merge pull request #4640 from chimp1984/update-trade-stat-resource-file
sqrrm Oct 13, 2020
8647007
Accept segwit addresses when sending non-BSQ funds
oscarguindzberg Oct 12, 2020
e30a7e0
Merge pull request #4632 from oscarguindzberg/fixSendNonBsq
ripcurlx Oct 13, 2020
cc5bdfa
Change data response behaviour
chimp1984 Oct 14, 2020
b0bc3d0
Remove lombok getter for date and rename getDate to getDateAsLong and…
chimp1984 Oct 14, 2020
5f9d3d1
Add GetInventory messages
chimp1984 Oct 14, 2020
32b953b
Improve GetInventoryRequester and GetInventoryRequestManager
chimp1984 Oct 14, 2020
8ed83ca
Merge pull request #4642 from chimp1984/change-handling-of-trade-stat…
sqrrm Oct 14, 2020
c41bfd7
Merge pull request #4643 from chimp1984/add-get-inventory-msg
sqrrm Oct 14, 2020
866b227
Replace emzy's v2 seednodes with new v3 seednodes
wiz Oct 14, 2020
58f5066
Resolve conflict in 'core/src/main/resources/btc_mainnet.seednodes'.
mrosseel Oct 14, 2020
feb4e52
Use toString for NullPointerException
chimp1984 Oct 14, 2020
fc87524
Add dont show again check box to validation exception popups
chimp1984 Oct 14, 2020
fe3828e
Dont include dead transactions in check for unconfirmed txs chain
chimp1984 Oct 14, 2020
8b404e1
Exclude time-locked txs at isUnconfirmedTransactionsLimitHit
chimp1984 Oct 15, 2020
9946496
Merge pull request #4647 from chimp1984/persist-seen-mediator-warnings
ripcurlx Oct 15, 2020
4f26544
Merge pull request #4648 from chimp1984/dont-include-dead-txs-in-limi…
ripcurlx Oct 15, 2020
b7c6c42
Update bitcoinj checkpoints for v1.4.0
ripcurlx Oct 14, 2020
c08a9bd
Only remove offer locally when necessary
ripcurlx Oct 15, 2020
101c172
Merge pull request #4651 from ripcurlx/keep-offer-when-canceling
sqrrm Oct 15, 2020
4e2e523
Update data stores for v1.4.0
ripcurlx Oct 15, 2020
10b05aa
Revert jdk.module.illegalAccess=deny
ripcurlx Oct 15, 2020
bac1e7b
Revert to SNAPSHOT version
ripcurlx Oct 16, 2020
3e17058
Move segwit checkbox
oscarguindzberg Oct 16, 2020
6b4d77f
Handle Capabilities for encrypted messages (offer availibility reques…
chimp1984 Oct 16, 2020
0b38fcc
Add file name to temp file at write to disk
chimp1984 Oct 16, 2020
8cb6a05
Fix min height for trade statistics table
chimp1984 Oct 16, 2020
294b45d
Republish trade statistics if not found in existing trade stats.
chimp1984 Oct 16, 2020
b924107
Merge pull request #4659 from chimp1984/fix-missing-capability-handli…
sqrrm Oct 16, 2020
0dea954
Merge pull request #4662 from chimp1984/fix-republish-trade-stats
sqrrm Oct 16, 2020
b5d16bc
Merge pull request #4658 from oscarguindzberg/moveSegwitCheckbox
ripcurlx Oct 17, 2020
7ae6e84
Bump version number for v1.4.1
ripcurlx Oct 18, 2020
b1fb571
Revert to SNAPSHOT version
ripcurlx Oct 19, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ configure(subprojects) {

ext { // in alphabetical order
bcVersion = '1.63'
bitcoinjVersion = '44ddbdc'
bitcoinjVersion = 'a733034'
btcdCli4jVersion = '27b94333'
codecVersion = '1.13'
easybindVersion = '1.0.3'
Expand Down Expand Up @@ -385,7 +385,7 @@ configure(project(':desktop')) {
apply plugin: 'witness'
apply from: '../gradle/witness/gradle-witness.gradle'

version = '1.3.9-SNAPSHOT'
version = '1.4.1-SNAPSHOT'

mainClassName = 'bisq.desktop.app.BisqAppMain'

Expand Down
18 changes: 18 additions & 0 deletions common/src/main/java/bisq/common/app/Capabilities.java
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,10 @@ public boolean containsAll(Capability... capabilities) {
return this.capabilities.containsAll(Arrays.asList(capabilities));
}

public boolean contains(Capability capability) {
return this.capabilities.contains(capability);
}

public boolean isEmpty() {
return capabilities.isEmpty();
}
Expand Down Expand Up @@ -180,4 +184,18 @@ public String prettyPrint() {
public int size() {
return capabilities.size();
}

// We return true if our capabilities have less capabilities than the parameter value
public boolean hasLess(Capabilities other) {
return findHighestCapability(this) < findHighestCapability(other);
}

// We use the sum of all capabilities. Alternatively we could use the highest entry.
// Neither would support removal of past capabilities, a use case we never had so far and which might have
// backward compatibility issues, so we should treat capabilities as an append-only data structure.
public int findHighestCapability(Capabilities capabilities) {
return (int) capabilities.capabilities.stream()
.mapToLong(e -> (long) e.ordinal())
.sum();
}
}
4 changes: 3 additions & 1 deletion common/src/main/java/bisq/common/app/Capability.java
Original file line number Diff line number Diff line change
Expand Up @@ -40,5 +40,7 @@ public enum Capability {
SIGNED_ACCOUNT_AGE_WITNESS, // Supports the signed account age witness feature
MEDIATION, // Supports mediation feature
REFUND_AGENT, // Supports refund agents
TRADE_STATISTICS_HASH_UPDATE // We changed the hash method in 1.2.0 and that requires update to 1.2.2 for handling it correctly, otherwise the seed nodes have to process too much data.
TRADE_STATISTICS_HASH_UPDATE, // We changed the hash method in 1.2.0 and that requires update to 1.2.2 for handling it correctly, otherwise the seed nodes have to process too much data.
NO_ADDRESS_PRE_FIX, // At 1.4.0 we removed the prefix filter for mailbox messages. If a peer has that capability we do not sent the prefix.
TRADE_STATISTICS_3 // We used a new reduced trade statistics model from v1.4.0 on
}
5 changes: 2 additions & 3 deletions common/src/main/java/bisq/common/app/Version.java
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,12 @@ public class Version {
// VERSION = 0.5.0 introduces proto buffer for the P2P network and local DB and is a not backward compatible update
// Therefore all sub versions start again with 1
// We use semantic versioning with major, minor and patch
public static final String VERSION = "1.3.9";
public static final String VERSION = "1.4.1";

/**
* Holds a list of the versions of tagged resource files for optimizing the getData requests.
*/
public static final List<String> HISTORY = Arrays.asList("1.4.0");
public static final List<String> HISTORY = Arrays.asList("1.4.1");

public static int getMajorVersion(String version) {
return getSubVersion(version, 0);
Expand Down Expand Up @@ -128,7 +128,6 @@ public static void printVersion() {
'}');
}

//TODO move to consensus area
public static final byte COMPENSATION_REQUEST = (byte) 0x01;
public static final byte REIMBURSEMENT_REQUEST = (byte) 0x01;
public static final byte PROPOSAL = (byte) 0x01;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,5 @@
* Better to use the excludeFromJsonDataMap (annotated with @JsonExclude; used in PaymentAccountPayload) to
* add a key/value pair.
*/
// TODO PubKeyRing and NodeAddress (network) are using UsedForTradeContractJson that is why it is in common module,
// which is a bit weird... Maybe we need either rename common or split it to util and common where common is common code
// used in network and core?
public interface UsedForTradeContractJson {
}
1 change: 0 additions & 1 deletion common/src/main/java/bisq/common/crypto/Encryption.java
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

// TODO is Hmac needed/make sense?
public class Encryption {
private static final Logger log = LoggerFactory.getLogger(Encryption.class);

Expand Down
1 change: 0 additions & 1 deletion common/src/main/java/bisq/common/crypto/KeyStorage.java
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@

import static bisq.common.util.Preconditions.checkDir;

// TODO: use a password protection for key storage
@Singleton
public class KeyStorage {
private static final Logger log = LoggerFactory.getLogger(KeyStorage.class);
Expand Down
103 changes: 63 additions & 40 deletions common/src/main/java/bisq/common/file/JsonFileManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,26 @@
import java.io.File;
import java.io.PrintWriter;

import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.ThreadPoolExecutor;

import lombok.extern.slf4j.Slf4j;

import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

@Slf4j
public class JsonFileManager {
private final ThreadPoolExecutor executor = Utilities.getThreadPoolExecutor("JsonFileManagerExecutor", 5, 50, 60);
private final static List<JsonFileManager> INSTANCES = new ArrayList<>();

public static void shutDownAllInstances() {
INSTANCES.forEach(JsonFileManager::shutDown);
}


@Nullable
private ThreadPoolExecutor executor;
private final File dir;


Expand All @@ -41,52 +54,62 @@ public class JsonFileManager {
public JsonFileManager(File dir) {
this.dir = dir;

if (!dir.exists())
if (!dir.mkdir())
log.warn("make dir failed");
if (!dir.exists() && !dir.mkdir()) {
log.warn("make dir failed");
}

INSTANCES.add(this);
}

Runtime.getRuntime().addShutdownHook(new Thread(JsonFileManager.this::shutDown,
"JsonFileManager.ShutDownHook"));
@NotNull
protected ThreadPoolExecutor getExecutor() {
if (executor == null) {
executor = Utilities.getThreadPoolExecutor("JsonFileManagerExecutor", 5, 50, 60);
}
return executor;
}

public void shutDown() {
executor.shutdown();
if (executor != null) {
executor.shutdown();
}
}

public void writeToDisc(String json, String fileName) {
executor.execute(() -> {
File jsonFile = new File(Paths.get(dir.getAbsolutePath(), fileName + ".json").toString());
File tempFile = null;
PrintWriter printWriter = null;
try {
tempFile = File.createTempFile("temp", null, dir);
if (!executor.isShutdown() && !executor.isTerminated() && !executor.isTerminating())
tempFile.deleteOnExit();

printWriter = new PrintWriter(tempFile);
printWriter.println(json);

// This close call and comment is borrowed from FileManager. Not 100% sure it that is really needed but
// seems that had fixed in the past and we got reported issues on Windows so that fix might be still
// required.
// Close resources before replacing file with temp file because otherwise it causes problems on windows
// when rename temp file
printWriter.close();
public void writeToDiscThreaded(String json, String fileName) {
getExecutor().execute(() -> writeToDisc(json, fileName));
}

FileUtil.renameFile(tempFile, jsonFile);
} catch (Throwable t) {
log.error("storageFile " + jsonFile.toString());
t.printStackTrace();
} finally {
if (tempFile != null && tempFile.exists()) {
log.warn("Temp file still exists after failed save. We will delete it now. storageFile=" + fileName);
if (!tempFile.delete())
log.error("Cannot delete temp file.");
}

if (printWriter != null)
printWriter.close();
public void writeToDisc(String json, String fileName) {
File jsonFile = new File(Paths.get(dir.getAbsolutePath(), fileName + ".json").toString());
File tempFile = null;
PrintWriter printWriter = null;
try {
tempFile = File.createTempFile("temp", null, dir);
tempFile.deleteOnExit();

printWriter = new PrintWriter(tempFile);
printWriter.println(json);

// This close call and comment is borrowed from FileManager. Not 100% sure it that is really needed but
// seems that had fixed in the past and we got reported issues on Windows so that fix might be still
// required.
// Close resources before replacing file with temp file because otherwise it causes problems on windows
// when rename temp file
printWriter.close();

FileUtil.renameFile(tempFile, jsonFile);
} catch (Throwable t) {
log.error("storageFile " + jsonFile.toString());
t.printStackTrace();
} finally {
if (tempFile != null && tempFile.exists()) {
log.warn("Temp file still exists after failed save. We will delete it now. storageFile=" + fileName);
if (!tempFile.delete())
log.error("Cannot delete temp file.");
}
});

if (printWriter != null)
printWriter.close();
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,7 @@ public void writeToDisk(protobuf.PersistableEnvelope serialized, @Nullable Runna

tempFile = usedTempFilePath != null
? FileUtil.createNewFile(usedTempFilePath)
: File.createTempFile("temp", null, dir);
: File.createTempFile("temp_" + fileName, null, dir);
// Don't use a new temp file path each time, as that causes the delete-on-exit hook to leak memory:
tempFile.deleteOnExit();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ public Message toProtoMessage() {
return getNetworkEnvelopeBuilder().build();
}

// todo remove
public protobuf.NetworkEnvelope toProtoNetworkEnvelope() {
return getNetworkEnvelopeBuilder().build();
}
Expand Down
42 changes: 42 additions & 0 deletions common/src/test/java/bisq/common/app/CapabilitiesTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@

import org.junit.Test;

import static bisq.common.app.Capability.DAO_FULL_NODE;
import static bisq.common.app.Capability.SEED_NODE;
import static bisq.common.app.Capability.TRADE_STATISTICS;
import static bisq.common.app.Capability.TRADE_STATISTICS_2;
Expand All @@ -40,6 +41,47 @@ public void testNoCapabilitiesAvailable() {
assertFalse(DUT.containsAll(new Capabilities(SEED_NODE)));
}

@Test
public void testHasLess() {
assertTrue(new Capabilities().hasLess(new Capabilities(SEED_NODE)));
assertFalse(new Capabilities().hasLess(new Capabilities()));
assertFalse(new Capabilities(SEED_NODE).hasLess(new Capabilities()));
assertTrue(new Capabilities(SEED_NODE).hasLess(new Capabilities(DAO_FULL_NODE)));
assertFalse(new Capabilities(DAO_FULL_NODE).hasLess(new Capabilities(SEED_NODE)));

Capabilities all = new Capabilities(
TRADE_STATISTICS,
TRADE_STATISTICS_2,
Capability.ACCOUNT_AGE_WITNESS,
Capability.ACK_MSG,
Capability.PROPOSAL,
Capability.BLIND_VOTE,
Capability.DAO_STATE,
Capability.BUNDLE_OF_ENVELOPES,
Capability.MEDIATION,
Capability.SIGNED_ACCOUNT_AGE_WITNESS,
Capability.REFUND_AGENT,
Capability.TRADE_STATISTICS_HASH_UPDATE
);
Capabilities other = new Capabilities(
TRADE_STATISTICS,
TRADE_STATISTICS_2,
Capability.ACCOUNT_AGE_WITNESS,
Capability.ACK_MSG,
Capability.PROPOSAL,
Capability.BLIND_VOTE,
Capability.DAO_STATE,
Capability.BUNDLE_OF_ENVELOPES,
Capability.MEDIATION,
Capability.SIGNED_ACCOUNT_AGE_WITNESS,
Capability.REFUND_AGENT,
Capability.TRADE_STATISTICS_HASH_UPDATE,
Capability.NO_ADDRESS_PRE_FIX
);

assertTrue(all.hasLess(other));
}

@Test
public void testO() {
Capabilities DUT = new Capabilities(TRADE_STATISTICS);
Expand Down
4 changes: 2 additions & 2 deletions core/src/main/java/bisq/core/api/CoreApi.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
import bisq.core.offer.Offer;
import bisq.core.offer.OfferPayload;
import bisq.core.payment.PaymentAccount;
import bisq.core.trade.statistics.TradeStatistics2;
import bisq.core.trade.statistics.TradeStatistics3;
import bisq.core.trade.statistics.TradeStatisticsManager;

import bisq.common.app.Version;
Expand Down Expand Up @@ -196,7 +196,7 @@ public void removeWalletPassword(String password) {
walletsService.removeWalletPassword(password);
}

public List<TradeStatistics2> getTradeStatistics() {
public List<TradeStatistics3> getTradeStatistics() {
return new ArrayList<>(tradeStatisticsManager.getObservableTradeStatisticsSet());
}

Expand Down
2 changes: 2 additions & 0 deletions core/src/main/java/bisq/core/app/BisqExecutable.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
import bisq.core.setup.CorePersistedDataHost;
import bisq.core.setup.CoreSetup;
import bisq.core.support.dispute.arbitration.arbitrator.ArbitratorManager;
import bisq.core.trade.statistics.TradeStatisticsManager;
import bisq.core.trade.txproof.xmr.XmrTxProofService;

import bisq.network.p2p.P2PService;
Expand Down Expand Up @@ -220,6 +221,7 @@ public void gracefulShutDown(ResultHandler resultHandler) {

try {
injector.getInstance(ArbitratorManager.class).shutDown();
injector.getInstance(TradeStatisticsManager.class).shutDown();
injector.getInstance(XmrTxProofService.class).shutDown();
injector.getInstance(DaoSetup.class).shutDown();
injector.getInstance(AvoidStandbyModeService.class).shutDown();
Expand Down
2 changes: 2 additions & 0 deletions core/src/main/java/bisq/core/app/BisqSetup.java
Original file line number Diff line number Diff line change
Expand Up @@ -389,6 +389,8 @@ private void initWallet() {
if (requestWalletPasswordHandler != null) {
requestWalletPasswordHandler.accept(aesKey -> {
walletsManager.setAesKey(aesKey);
walletsSetup.getWalletConfig().maybeAddSegwitKeychain(walletsSetup.getWalletConfig().btcWallet(),
aesKey);
if (preferences.isResyncSpvRequested()) {
if (showFirstPopupIfResyncSPVRequestedHandler != null)
showFirstPopupIfResyncSPVRequestedHandler.run();
Expand Down
2 changes: 1 addition & 1 deletion core/src/main/java/bisq/core/app/WalletAppSetup.java
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ void init(@Nullable Consumer<String> chainFileLockedExceptionHandler,
Runnable downloadCompleteHandler,
Runnable walletInitializedHandler) {
log.info("Initialize WalletAppSetup with BitcoinJ version {} and hash of BitcoinJ commit {}",
VersionMessage.BITCOINJ_VERSION, "44ddbdc");
VersionMessage.BITCOINJ_VERSION, "a733034");

ObjectProperty<Throwable> walletServiceException = new SimpleObjectProperty<>();
btcInfoBinding = EasyBind.combine(walletsSetup.downloadPercentageProperty(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
import bisq.core.btc.setup.WalletsSetup;
import bisq.core.btc.wallet.BsqWalletService;
import bisq.core.btc.wallet.BtcWalletService;
import bisq.core.dao.DaoSetup;
import bisq.core.offer.OpenOfferManager;
import bisq.core.support.dispute.arbitration.arbitrator.ArbitratorManager;

Expand All @@ -31,6 +32,7 @@
import bisq.common.UserThread;
import bisq.common.app.DevEnv;
import bisq.common.config.Config;
import bisq.common.file.JsonFileManager;
import bisq.common.handlers.ResultHandler;
import bisq.common.persistence.PersistenceManager;
import bisq.common.setup.GracefulShutDownHandler;
Expand Down Expand Up @@ -83,6 +85,8 @@ public void gracefulShutDown(ResultHandler resultHandler) {
log.info("gracefulShutDown");
try {
if (injector != null) {
JsonFileManager.shutDownAllInstances();
injector.getInstance(DaoSetup.class).shutDown();
injector.getInstance(ArbitratorManager.class).shutDown();
injector.getInstance(OpenOfferManager.class).shutDown(() -> injector.getInstance(P2PService.class).shutDown(() -> {
injector.getInstance(WalletsSetup.class).shutDownComplete.addListener((ov, o, n) -> {
Expand Down
Loading