Use ToImmutableArray()
MODIFY
WalletWasabi/Blockchain/Keys/KeyManager.cs
WalletWasabi/Blockchain/Keys/KeyManager.cs
@@ -2,6 +2,7 @@ using NBitcoin;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
+using System.Collections.Immutable;
using System.Diagnostics.CodeAnalysis;
using System.IO;
using System.Linq;
@@ -420,7 +421,7 @@ namespace WalletWasabi.Blockchain.Keys
{
lock (HdPubKeyScriptBytesLock)
{
- return HdPubKeyScriptBytes;
+ return HdPubKeyScriptBytes.ToImmutableArray();
}
}

MODIFY
WalletWasabi/Wallets/Wallet.cs
WalletWasabi/Wallets/Wallet.cs
@@ -473,7 +473,7 @@ namespace WalletWasabi.Wallets
private async Task ProcessFilterModelAsync(FilterModel filterModel, CancellationToken cancel)
{
- var matchFound = filterModel.Filter.MatchAny(KeyManager.GetPubKeyScriptBytes().ToList(), filterModel.FilterKey);
+ var matchFound = filterModel.Filter.MatchAny(KeyManager.GetPubKeyScriptBytes(), filterModel.FilterKey);
if (matchFound)
{
Block currentBlock = await BlockProvider.GetBlockAsync(filterModel.Header.BlockHash, cancel).ConfigureAwait(false); // Wait until not downloaded.

Use ToImmutableArray()