diff --git a/core/src/main/java/bisq/core/dao/burningman/accounting/storage/BurningManAccountingStoreService.java b/core/src/main/java/bisq/core/dao/burningman/accounting/storage/BurningManAccountingStoreService.java index 620cf42722d..98aa41a7bae 100644 --- a/core/src/main/java/bisq/core/dao/burningman/accounting/storage/BurningManAccountingStoreService.java +++ b/core/src/main/java/bisq/core/dao/burningman/accounting/storage/BurningManAccountingStoreService.java @@ -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; @@ -43,7 +48,7 @@ @Slf4j @Singleton public class BurningManAccountingStoreService extends StoreService { - private static final String FILE_NAME = "BurningManAccountingStore"; + private static final String FILE_NAME = "BurningManAccountingStore_v2"; @Inject public BurningManAccountingStoreService(ResourceDataStoreService resourceDataStoreService, @@ -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 @@ -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 diff --git a/core/src/main/resources/btc_mainnet.seednodes b/core/src/main/resources/btc_mainnet.seednodes index 8fa70fdbebd..1a21d7eda7f 100644 --- a/core/src/main/resources/btc_mainnet.seednodes +++ b/core/src/main/resources/btc_mainnet.seednodes @@ -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) diff --git a/core/src/test/java/bisq/core/util/RegexValidatorTest.java b/core/src/test/java/bisq/core/util/RegexValidatorTest.java index c708e80d7f1..3eb9f6c2273 100644 --- a/core/src/test/java/bisq/core/util/RegexValidatorTest.java +++ b/core/src/test/java/bisq/core/util/RegexValidatorTest.java @@ -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); @@ -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); } @@ -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); @@ -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); diff --git a/p2p/src/main/resources/BurningManAccountingStore_BTC_MAINNET b/p2p/src/main/resources/BurningManAccountingStore_v2_BTC_MAINNET similarity index 100% rename from p2p/src/main/resources/BurningManAccountingStore_BTC_MAINNET rename to p2p/src/main/resources/BurningManAccountingStore_v2_BTC_MAINNET