Fix litecoin registration

This commit is contained in:
nicolas.dorier
2018-01-08 23:05:41 +09:00
parent c3d37b1f78
commit c513d6bd44
2 changed files with 27 additions and 2 deletions

View File

@@ -8,6 +8,10 @@ namespace BTCPayServer
{
public class BTCPayNetworkProvider
{
static BTCPayNetworkProvider()
{
NBXplorer.Altcoins.Litecoin.Networks.EnsureRegistered();
}
Dictionary<string, BTCPayNetwork> _Networks = new Dictionary<string, BTCPayNetwork>();
public BTCPayNetworkProvider(Network network)
{
@@ -20,6 +24,13 @@ namespace BTCPayServer
NBitcoinNetwork = Network.Main,
UriScheme = "bitcoin",
});
Add(new BTCPayNetwork()
{
CryptoCode = "LTC",
BlockExplorerLink = "https://live.blockcypher.com/ltc/tx/{0}/",
NBitcoinNetwork = NBXplorer.Altcoins.Litecoin.Networks.Mainnet,
UriScheme = "litecoin",
});
}
if (network == Network.TestNet)
@@ -31,6 +42,13 @@ namespace BTCPayServer
NBitcoinNetwork = Network.TestNet,
UriScheme = "bitcoin",
});
Add(new BTCPayNetwork()
{
CryptoCode = "LTC",
BlockExplorerLink = "http://explorer.litecointools.com/tx/{0}",
NBitcoinNetwork = NBXplorer.Altcoins.Litecoin.Networks.Testnet,
UriScheme = "litecoin",
});
}
if (network == Network.RegTest)
@@ -42,10 +60,17 @@ namespace BTCPayServer
NBitcoinNetwork = Network.RegTest,
UriScheme = "bitcoin"
});
Add(new BTCPayNetwork()
{
CryptoCode = "LTC",
BlockExplorerLink = "http://explorer.litecointools.com/tx/{0}",
NBitcoinNetwork = NBXplorer.Altcoins.Litecoin.Networks.Regtest,
UriScheme = "litecoin",
});
}
}
[Obsolete("Should not be needed")]
[Obsolete("To use only for legacy stuff")]
public BTCPayNetwork BTC
{
get