BitcoinStore: Move folder paths up to Global.cs
MODIFY
WalletWasabi.Gui/Global.cs
WalletWasabi.Gui/Global.cs
@@ -102,12 +102,11 @@ namespace WalletWasabi.Gui
WalletManager.OnDequeue += WalletManager_OnDequeue;
WalletManager.WalletRelevantTransactionProcessed += WalletManager_WalletRelevantTransactionProcessed;
- var indexStore = new IndexStore(Network, new SmartHeaderChain());
+ var networkWorkFolderPath = Path.Combine(DataDir, "BitcoinStore", Network.ToString());
+ var transactionStore = new AllTransactionStore(networkWorkFolderPath, Network);
+ var indexStore = new IndexStore(Path.Combine(networkWorkFolderPath, "IndexStore"), Network, new SmartHeaderChain());
- BitcoinStore = new BitcoinStore(
- Path.Combine(DataDir, "BitcoinStore"), Network,
- indexStore, new AllTransactionStore(Network), new MempoolService()
- );
+ BitcoinStore = new BitcoinStore(indexStore, transactionStore, new MempoolService());
SingleInstanceChecker = new SingleInstanceChecker(Network);
}

MODIFY
WalletWasabi/Stores/BitcoinStore.cs
WalletWasabi/Stores/BitcoinStore.cs
-using NBitcoin;
-using System;
-using System.Collections.Generic;
-using System.IO;
-using System.Text;
using System.Threading.Tasks;
using WalletWasabi.Blockchain.Blocks;
using WalletWasabi.Blockchain.Mempool;
using WalletWasabi.Blockchain.P2p;
using WalletWasabi.Blockchain.Transactions;
-using WalletWasabi.Helpers;
using WalletWasabi.Logging;
namespace WalletWasabi.Stores
@@ -20,25 +14,16 @@ namespace WalletWasabi.Stores
public class BitcoinStore
{
public BitcoinStore(
- string workFolderPath,
- Network network,
IndexStore indexStore,
AllTransactionStore transactionStore,
MempoolService mempoolService)
{
- var workFolderPath2 = Guard.NotNullOrEmptyOrWhitespace(nameof(workFolderPath), workFolderPath, trim: true);
-
- NetworkWorkFolderPath = Path.Combine(workFolderPath2, network.ToString());
- IndexStoreFolderPath = Path.Combine(NetworkWorkFolderPath, "IndexStore");
-
IndexStore = indexStore;
TransactionStore = transactionStore;
MempoolService = mempoolService;
}
public bool IsInitialized { get; private set; }
- private string NetworkWorkFolderPath { get; }
- private string IndexStoreFolderPath { get; }
public IndexStore IndexStore { get; }
public AllTransactionStore TransactionStore { get; }
@@ -57,8 +42,8 @@ namespace WalletWasabi.Stores
{
var initTasks = new[]
{
- IndexStore.InitializeAsync(IndexStoreFolderPath),
- TransactionStore.InitializeAsync(NetworkWorkFolderPath)
+ IndexStore.InitializeAsync(),
+ TransactionStore.InitializeAsync()
};
await Task.WhenAll(initTasks).ConfigureAwait(false);

BitcoinStore: Move folder paths up to Global.cs