Fix a few nullable warnings.
MODIFY
WalletWasabi.Fluent/Global.cs
WalletWasabi.Fluent/Global.cs
@@ -255,7 +255,7 @@ public class Global
{
if (Config.StartLocalBitcoinCoreOnStartup)
{
- BitcoinCoreNode = await CoreNode
+ CoreNode coreNode = await CoreNode
.CreateAsync(
new CoreNodeParams(
Network,
@@ -274,7 +274,8 @@ public class Global
cancel)
.ConfigureAwait(false);
- RegisterLocalNodeDependantComponents();
+ RegisterLocalNodeDependantComponents(coreNode);
+ BitcoinCoreNode = coreNode;
}
}
catch (Exception ex)
@@ -283,12 +284,12 @@ public class Global
}
}
- private void RegisterLocalNodeDependantComponents()
+ private void RegisterLocalNodeDependantComponents(CoreNode coreNode)
{
- HostedServices.Register<BlockNotifier>(() => new BlockNotifier(TimeSpan.FromSeconds(7), BitcoinCoreNode.RpcClient, BitcoinCoreNode.P2pNode), "Block Notifier");
- HostedServices.Register<RpcMonitor>(() => new RpcMonitor(TimeSpan.FromSeconds(7), BitcoinCoreNode.RpcClient), "RPC Monitor");
- HostedServices.Register<RpcFeeProvider>(() => new RpcFeeProvider(TimeSpan.FromMinutes(1), BitcoinCoreNode.RpcClient, HostedServices.Get<RpcMonitor>()), "RPC Fee Provider");
- HostedServices.Register<MempoolMirror>(() => new MempoolMirror(TimeSpan.FromSeconds(21), BitcoinCoreNode.RpcClient, BitcoinCoreNode.P2pNode), "Full Node Mempool Mirror");
+ HostedServices.Register<BlockNotifier>(() => new BlockNotifier(TimeSpan.FromSeconds(7), coreNode.RpcClient, coreNode.P2pNode), "Block Notifier");
+ HostedServices.Register<RpcMonitor>(() => new RpcMonitor(TimeSpan.FromSeconds(7), coreNode.RpcClient), "RPC Monitor");
+ HostedServices.Register<RpcFeeProvider>(() => new RpcFeeProvider(TimeSpan.FromMinutes(1), coreNode.RpcClient, HostedServices.Get<RpcMonitor>()), "RPC Fee Provider");
+ HostedServices.Register<MempoolMirror>(() => new MempoolMirror(TimeSpan.FromSeconds(21), coreNode.RpcClient, coreNode.P2pNode), "Full Node Mempool Mirror");
}
private void RegisterFeeRateProviders()
@@ -417,7 +418,7 @@ public class Global
}
catch (Exception ex)
{
- Logger.LogError($"Error during the disposal of {nameof(BitcoinStore)}: {ex}");
+ Logger.LogError($"Error during the disposal of {nameof(IndexStore)} and {nameof(AllTransactionStore)}: {ex}");
}
}
catch (Exception ex)

MODIFY
WalletWasabi/BitcoinCore/CoreNodeParams.cs
WalletWasabi/BitcoinCore/CoreNodeParams.cs
@@ -20,7 +20,7 @@ public class CoreNodeParams
int? prune,
string mempoolReplacement,
string userAgent,
- Money fallbackFee,
+ Money? fallbackFee,
IMemoryCache cache)
{
Network = Guard.NotNull(nameof(network), network);
@@ -47,7 +47,7 @@ public class CoreNodeParams
public int? Prune { get; }
public string MempoolReplacement { get; }
public string UserAgent { get; }
- public Money FallbackFee { get; }
+ public Money? FallbackFee { get; }
public int? Listen { get; set; }
public int? ListenOnion { get; set; }
public int? Discover { get; set; }

Fix a few nullable warnings.