mirror of
https://github.com/btcpayserver/btcpayserver.git
synced 2024-11-19 09:54:30 +01:00
Remove the concept of unfiltered networks
This commit is contained in:
parent
26112a1ed6
commit
1fb75c908b
@ -22,7 +22,6 @@ namespace BTCPayServer
|
||||
|
||||
BTCPayNetworkProvider(BTCPayNetworkProvider unfiltered, string[] cryptoCodes)
|
||||
{
|
||||
UnfilteredNetworks = unfiltered.UnfilteredNetworks ?? unfiltered;
|
||||
NetworkType = unfiltered.NetworkType;
|
||||
_NBXplorerNetworkProvider = new NBXplorerNetworkProvider(unfiltered.NetworkType);
|
||||
_Networks = new Dictionary<string, BTCPayNetworkBase>();
|
||||
@ -36,12 +35,10 @@ namespace BTCPayServer
|
||||
}
|
||||
}
|
||||
|
||||
public BTCPayNetworkProvider UnfilteredNetworks { get; }
|
||||
|
||||
public NetworkType NetworkType { get; private set; }
|
||||
public BTCPayNetworkProvider(NetworkType networkType)
|
||||
{
|
||||
UnfilteredNetworks = this;
|
||||
_NBXplorerNetworkProvider = new NBXplorerNetworkProvider(networkType);
|
||||
NetworkType = networkType;
|
||||
InitBitcoin();
|
||||
|
@ -64,7 +64,6 @@ namespace BTCPayServer.Data
|
||||
{
|
||||
if (storeData == null)
|
||||
throw new ArgumentNullException(nameof(storeData));
|
||||
networks = networks.UnfilteredNetworks;
|
||||
#pragma warning disable CS0618
|
||||
bool btcReturned = false;
|
||||
|
||||
|
@ -26,7 +26,7 @@ namespace BTCPayServer.Services
|
||||
{
|
||||
public BTCPayNetworkJsonSerializerSettings(BTCPayNetworkProvider networkProvider, IEnumerable<IJsonConverterRegistration> jsonSerializers)
|
||||
{
|
||||
foreach (var network in networkProvider.UnfilteredNetworks.GetAll().OfType<BTCPayNetwork>())
|
||||
foreach (var network in networkProvider.GetAll().OfType<BTCPayNetwork>())
|
||||
{
|
||||
var serializer = new JsonSerializerSettings();
|
||||
foreach (var jsonSerializer in jsonSerializers)
|
||||
|
@ -554,7 +554,12 @@ namespace BTCPayServer.Services.Invoices
|
||||
r.CryptoCode = paymentMethodId.CryptoCode;
|
||||
r.PaymentType = paymentMethodId.PaymentType.ToString();
|
||||
r.ParentEntity = this;
|
||||
r.Network = Networks?.UnfilteredNetworks.GetNetwork<BTCPayNetworkBase>(r.CryptoCode);
|
||||
if (Networks != null)
|
||||
{
|
||||
r.Network = Networks.GetNetwork<BTCPayNetworkBase>(r.CryptoCode);
|
||||
if (r.Network is null)
|
||||
continue;
|
||||
}
|
||||
paymentMethods.Add(r);
|
||||
}
|
||||
}
|
||||
|
@ -45,7 +45,7 @@ retry:
|
||||
catch when (retryCount++ < 5) { goto retry; }
|
||||
_IndexerThread = new CustomThreadPool(1, "Invoice Indexer");
|
||||
_ContextFactory = contextFactory;
|
||||
_Networks = networks.UnfilteredNetworks;
|
||||
_Networks = networks;
|
||||
}
|
||||
|
||||
public InvoiceEntity CreateNewInvoice()
|
||||
|
Loading…
Reference in New Issue
Block a user