Skip to content

Commit

Permalink
Use new burningman accounting file recreated from scratch.
Browse files Browse the repository at this point in the history
Remove old file.

The current accounting data are missing about 10% of transactions due to threading issues at processing the transactions in earlier versions.

Signed-off-by: HenrikJannsen <boilingfrog@gmx.com>
  • Loading branch information
HenrikJannsen committed Jun 23, 2023
1 parent edfa035 commit e2b6d4a
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
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
Binary file not shown.

0 comments on commit e2b6d4a

Please sign in to comment.