mirror of
https://github.com/btcpayserver/btcpayserver.git
synced 2024-11-19 01:43:50 +01:00
Remove useless code (#2852)
This commit is contained in:
parent
180be49824
commit
14a10eeef8
@ -70,40 +70,6 @@ namespace BTCPayServer
|
||||
public bool SupportPayJoin { get; set; } = false;
|
||||
public bool SupportLightning { get; set; } = true;
|
||||
|
||||
public KeyPath GetRootKeyPath(DerivationType type)
|
||||
{
|
||||
KeyPath baseKey;
|
||||
if (!NBitcoinNetwork.Consensus.SupportSegwit)
|
||||
{
|
||||
baseKey = new KeyPath("44'");
|
||||
}
|
||||
else
|
||||
{
|
||||
switch (type)
|
||||
{
|
||||
case DerivationType.Legacy:
|
||||
baseKey = new KeyPath("44'");
|
||||
break;
|
||||
case DerivationType.SegwitP2SH:
|
||||
baseKey = new KeyPath("49'");
|
||||
break;
|
||||
case DerivationType.Segwit:
|
||||
baseKey = new KeyPath("84'");
|
||||
break;
|
||||
default:
|
||||
throw new ArgumentOutOfRangeException(nameof(type), type, null);
|
||||
}
|
||||
}
|
||||
return baseKey
|
||||
.Derive(CoinType);
|
||||
}
|
||||
|
||||
public KeyPath GetRootKeyPath()
|
||||
{
|
||||
return new KeyPath(NBitcoinNetwork.Consensus.SupportSegwit ? "49'" : "44'")
|
||||
.Derive(CoinType);
|
||||
}
|
||||
|
||||
public override T ToObject<T>(string json)
|
||||
{
|
||||
return NBXplorerNetwork.Serializer.ToObject<T>(json);
|
||||
|
@ -52,7 +52,6 @@ namespace BTCPayServer.Controllers
|
||||
|
||||
var (hotWallet, rpcImport) = await CanUseHotWallet();
|
||||
vm.Network = network;
|
||||
vm.RootKeyPath = network.GetRootKeyPath();
|
||||
vm.CanUseHotWallet = hotWallet;
|
||||
vm.CanUseRPCImport = rpcImport;
|
||||
vm.SupportTaproot = network.NBitcoinNetwork.Consensus.SupportTaproot;
|
||||
@ -82,7 +81,6 @@ namespace BTCPayServer.Controllers
|
||||
}
|
||||
|
||||
vm.Network = network;
|
||||
vm.RootKeyPath = network.GetRootKeyPath();
|
||||
DerivationSchemeSettings strategy = null;
|
||||
|
||||
var wallet = _WalletProvider.GetWallet(network);
|
||||
@ -214,7 +212,6 @@ namespace BTCPayServer.Controllers
|
||||
vm.SupportTaproot = network.NBitcoinNetwork.Consensus.SupportTaproot;
|
||||
vm.SupportSegwit = network.NBitcoinNetwork.Consensus.SupportSegwit;
|
||||
vm.IsTaprootActivated = TaprootActivated(vm.CryptoCode);
|
||||
vm.RootKeyPath = network.GetRootKeyPath();
|
||||
vm.Network = network;
|
||||
|
||||
if (vm.Method == null)
|
||||
@ -260,7 +257,6 @@ namespace BTCPayServer.Controllers
|
||||
SetupRequest = request,
|
||||
Confirmation = string.IsNullOrEmpty(request.ExistingMnemonic),
|
||||
Network = network,
|
||||
RootKeyPath = network.GetRootKeyPath(),
|
||||
Source = isImport ? "SeedImported" : "NBXplorerGenerated",
|
||||
IsHotWallet = isImport ? request.SavePrivateKeys : method == WalletSetupMethod.HotWallet,
|
||||
DerivationSchemeFormat = "BTCPay",
|
||||
@ -389,7 +385,6 @@ namespace BTCPayServer.Controllers
|
||||
|
||||
vm.CanUseHotWallet = hotWallet;
|
||||
vm.CanUseRPCImport = rpcImport;
|
||||
vm.RootKeyPath = network.GetRootKeyPath();
|
||||
vm.Network = network;
|
||||
vm.Source = derivation.Source;
|
||||
vm.RootFingerprint = derivation.GetSigningAccountKeySettings().RootFingerprint.ToString();
|
||||
|
@ -22,8 +22,6 @@ namespace BTCPayServer.Models.StoreViewModels
|
||||
public string RootFingerprint { get; set; }
|
||||
public bool Confirmation { get; set; }
|
||||
|
||||
public KeyPath RootKeyPath { get; set; }
|
||||
|
||||
[Display(Name = "Wallet file")]
|
||||
public IFormFile WalletFile { get; set; }
|
||||
[Display(Name = "Wallet file content")]
|
||||
|
Loading…
Reference in New Issue
Block a user