Replace BitcoinStore with SmartHeaderChain in StatusBarViewModel.
MODIFY
WalletWasabi.Gui/Program.cs
WalletWasabi.Gui/Program.cs
@@ -100,7 +100,7 @@ namespace WalletWasabi.Gui
try
{
SetTheme();
- var statusBarViewModel = new StatusBarViewModel(Global.DataDir, Global.Network, Global.Config, Global.HostedServices, Global.BitcoinStore, Global.LegalDocuments);
+ var statusBarViewModel = new StatusBarViewModel(Global.DataDir, Global.Network, Global.Config, Global.HostedServices, Global.BitcoinStore.SmartHeaderChain, Global.LegalDocuments);
MainWindowViewModel.Instance = new MainWindowViewModel(Global.Network, Global.UiConfig, Global.WalletManager, statusBarViewModel, IoC.Get<IShell>());
await Global.InitializeNoWalletAsync();

MODIFY
WalletWasabi.Gui/ViewModels/StatusBarViewModel.cs
WalletWasabi.Gui/ViewModels/StatusBarViewModel.cs
-using Avalonia.Threading;
using AvalonStudio.Extensibility;
using AvalonStudio.Shell;
using NBitcoin;
using NBitcoin.Protocol;
-using Nito.AsyncEx;
using ReactiveUI;
-using Splat;
using System;
-using System.Collections.Generic;
-using System.Collections.ObjectModel;
using System.IO;
using System.Linq;
-using System.Net.Http;
using System.Reactive;
using System.Reactive.Disposables;
using System.Reactive.Linq;
using System.Runtime.InteropServices;
using System.Threading;
-using System.Threading.Tasks;
using WalletWasabi.BitcoinCore.Monitoring;
using WalletWasabi.Blockchain.Blocks;
using WalletWasabi.Exceptions;
-using WalletWasabi.Gui.Converters;
using WalletWasabi.Gui.Dialogs;
using WalletWasabi.Gui.Helpers;
using WalletWasabi.Gui.Models.StatusBarStatuses;
@@ -31,7 +23,6 @@ using WalletWasabi.Legal;
using WalletWasabi.Logging;
using WalletWasabi.Models;
using WalletWasabi.Services;
-using WalletWasabi.Stores;
using WalletWasabi.Wallets;
using WalletWasabi.WebClients.Wasabi;
@@ -57,13 +48,13 @@ namespace WalletWasabi.Gui.ViewModels
private volatile bool _disposedValue = false; // To detect redundant calls
- public StatusBarViewModel(string dataDir, Network network, Config config, HostedServices hostedServices, BitcoinStore bitcoinStore, LegalDocuments? legalDocuments)
+ public StatusBarViewModel(string dataDir, Network network, Config config, HostedServices hostedServices, SmartHeaderChain smartHeaderChain, LegalDocuments? legalDocuments)
{
DataDir = dataDir;
Network = network;
Config = config;
HostedServices = hostedServices;
- BitcoinStore = bitcoinStore;
+ SmartHeaderChain = smartHeaderChain;
LegalDocuments = legalDocuments;
Backend = BackendStatus.NotConnected;
UseTor = false;
@@ -76,7 +67,6 @@ namespace WalletWasabi.Gui.ViewModels
private CompositeDisposable Disposables { get; } = new CompositeDisposable();
private NodesCollection Nodes { get; set; }
private WasabiSynchronizer Synchronizer { get; set; }
- private SmartHeaderChain HashChain { get; set; }
private bool UseTor { get; set; }
@@ -92,7 +82,7 @@ namespace WalletWasabi.Gui.ViewModels
private HostedServices HostedServices { get; }
- private BitcoinStore BitcoinStore { get; }
+ private SmartHeaderChain SmartHeaderChain { get; }
private LegalDocuments? LegalDocuments { get; }
@@ -164,7 +154,6 @@ namespace WalletWasabi.Gui.ViewModels
{
Nodes = nodes;
Synchronizer = synchronizer;
- HashChain = synchronizer.BitcoinStore.SmartHeaderChain;
UseTor = Config.UseTor; // Do not make it dynamic, because if you change this config settings only next time will it activate.
UseBitcoinCore = Config.StartLocalBitcoinCoreOnStartup;
@@ -217,7 +206,7 @@ namespace WalletWasabi.Gui.ViewModels
var segwitActivationHeight = SmartHeader.GetStartingHeader(wallet.Network).Height;
if (wallet.LastProcessedFilter?.Header?.Height is uint lastProcessedFilterHeight
&& lastProcessedFilterHeight > segwitActivationHeight
- && BitcoinStore.SmartHeaderChain.TipHeight is uint tipHeight
+ && SmartHeaderChain.TipHeight is uint tipHeight
&& tipHeight > segwitActivationHeight)
{
var allFilters = tipHeight - segwitActivationHeight;
@@ -261,7 +250,7 @@ namespace WalletWasabi.Gui.ViewModels
.Subscribe(_ => Backend = Synchronizer.BackendStatus)
.DisposeWith(Disposables);
- _filtersLeft = HashChain.WhenAnyValue(x => x.HashesLeft)
+ _filtersLeft = SmartHeaderChain.WhenAnyValue(x => x.HashesLeft)
.Throttle(TimeSpan.FromMilliseconds(100))
.ObserveOn(RxApp.MainThreadScheduler)
.ToProperty(this, x => x.FiltersLeft)

Replace BitcoinStore with SmartHeaderChain in StatusBarViewModel.