Skip to content

Commit

Permalink
Merge branch 'master' into release/v1.9.11
Browse files Browse the repository at this point in the history
  • Loading branch information
alejandrogarcia83 committed Jun 28, 2023
2 parents 4d7c577 + 8c70dd6 commit 23bea7a
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,19 @@
import bisq.network.p2p.storage.persistence.ResourceDataStoreService;
import bisq.network.p2p.storage.persistence.StoreService;

import bisq.common.UserThread;
import bisq.common.config.Config;
import bisq.common.file.FileUtil;
import bisq.common.persistence.PersistenceManager;

import javax.inject.Inject;
import javax.inject.Named;
import javax.inject.Singleton;

import java.nio.file.Path;

import java.io.File;
import java.io.IOException;

import java.util.ArrayList;
import java.util.List;
Expand All @@ -43,7 +48,7 @@
@Slf4j
@Singleton
public class BurningManAccountingStoreService extends StoreService<BurningManAccountingStore> {
private static final String FILE_NAME = "BurningManAccountingStore";
private static final String FILE_NAME = "BurningManAccountingStore_v2";

@Inject
public BurningManAccountingStoreService(ResourceDataStoreService resourceDataStoreService,
Expand All @@ -54,6 +59,19 @@ public BurningManAccountingStoreService(ResourceDataStoreService resourceDataSto
resourceDataStoreService.addService(this);
}

protected void readFromResources(String postFix, Runnable completeHandler) {
super.readFromResources(postFix, completeHandler);

UserThread.runAfter(() -> {
try {
// Delete old BurningManAccountingStore file which was missing some data.
FileUtil.deleteFileIfExists(Path.of(absolutePathOfStorageDir, "BurningManAccountingStore").toFile());
} catch (IOException e) {
throw new RuntimeException(e);
}
}, 5);
}


///////////////////////////////////////////////////////////////////////////////////////////
// API
Expand Down Expand Up @@ -100,7 +118,7 @@ protected BurningManAccountingStore createStore() {

@Override
protected void initializePersistenceManager() {
persistenceManager.initialize(store, PersistenceManager.Source.NETWORK);
persistenceManager.initialize(store, FILE_NAME, PersistenceManager.Source.NETWORK);
}

@Override
Expand Down
1 change: 0 additions & 1 deletion core/src/main/resources/btc_mainnet.seednodes
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# nodeaddress.onion:port [(@owner,@backup)]
wizseedscybbttk4bmb2lzvbuk2jtect37lcpva4l3twktmkzemwbead.onion:8000 (@wiz)
wizseed3d376esppbmbjxk2fhk2jg5fpucddrzj2kxtbxbx4vrnwclad.onion:8000 (@wiz)
wizseed7ab2gi3x267xahrp2pkndyrovczezzb46jk6quvguciuyqrid.onion:8000 (@wiz)
devinv3rhon24gqf5v6ondoqgyrbzyqihzyouzv7ptltsewhfmox2zqd.onion:8000 (@devinbileck)
Expand Down
8 changes: 4 additions & 4 deletions core/src/test/java/bisq/core/util/RegexValidatorTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ public void testAddressRegexValidator() {

// onion v3 addresses
assertFalse(regexValidator.validate("32zzibxmqi2ybxpqyggwwuwz7a3lbvtzoloti7cxoevyvijexvgsfei.onion:8333").isValid); // 1 missing char
assertTrue(regexValidator.validate("wizseedscybbttk4bmb2lzvbuk2jtect37lcpva4l3twktmkzemwbead.onion:8000").isValid);
assertTrue(regexValidator.validate("wizseed7ab2gi3x267xahrp2pkndyrovczezzb46jk6quvguciuyqrid.onion:8000").isValid);

// ipv4 addresses
assertTrue(regexValidator.validate("12.34.56.78").isValid);
Expand Down Expand Up @@ -120,7 +120,7 @@ public void testOnionAddressRegexValidator() {

// onion v3 addresses
assertFalse(regexValidator.validate("32zzibxmqi2ybxpqyggwwuwz7a3lbvtzoloti7cxoevyvijexvgsfei.onion:8333").isValid); // 1 missing char
assertTrue(regexValidator.validate("wizseedscybbttk4bmb2lzvbuk2jtect37lcpva4l3twktmkzemwbead.onion:8000").isValid);
assertTrue(regexValidator.validate("wizseed7ab2gi3x267xahrp2pkndyrovczezzb46jk6quvguciuyqrid.onion:8000").isValid);

}

Expand All @@ -147,7 +147,7 @@ public void testLocalnetAddressRegexValidator() {

// onion v3 addresses
assertFalse(regexValidator.validate("32zzibxmqi2ybxpqyggwwuwz7a3lbvtzoloti7cxoevyvijexvgsfei.onion:8333").isValid); // 1 missing char
assertFalse(regexValidator.validate("wizseedscybbttk4bmb2lzvbuk2jtect37lcpva4l3twktmkzemwbead.onion:8000").isValid);
assertFalse(regexValidator.validate("wizseed7ab2gi3x267xahrp2pkndyrovczezzb46jk6quvguciuyqrid.onion:8000").isValid);

// ipv4 addresses
assertFalse(regexValidator.validate("12.34.56.78").isValid);
Expand Down Expand Up @@ -236,7 +236,7 @@ public void testLocalhostAddressRegexValidator() {

// onion v3 addresses
assertFalse(regexValidator.validate("32zzibxmqi2ybxpqyggwwuwz7a3lbvtzoloti7cxoevyvijexvgsfei.onion:8333").isValid); // 1 missing char
assertFalse(regexValidator.validate("wizseedscybbttk4bmb2lzvbuk2jtect37lcpva4l3twktmkzemwbead.onion:8000").isValid);
assertFalse(regexValidator.validate("wizseed7ab2gi3x267xahrp2pkndyrovczezzb46jk6quvguciuyqrid.onion:8000").isValid);

// ipv4 addresses
assertFalse(regexValidator.validate("12.34.56.78").isValid);
Expand Down

0 comments on commit 23bea7a

Please sign in to comment.