Fix migration from old version to new version of WalletKeyPathRoots

This commit is contained in:
nicolas.dorier 2019-05-09 00:21:42 +09:00
parent 3bf4eea1fe
commit e5704abfb3
No known key found for this signature in database
GPG Key ID: 6618763EF09186FE
2 changed files with 3 additions and 3 deletions

View File

@ -98,7 +98,7 @@ namespace BTCPayServer.HostedServices
continue;
foreach (var scheme in store.GetSupportedPaymentMethods(_NetworkProvider).OfType<DerivationSchemeSettings>())
{
if (blob.WalletKeyPathRoots.TryGetValue(scheme.PaymentId.ToString(), out var root))
if (blob.WalletKeyPathRoots.TryGetValue(scheme.PaymentId.ToString().ToLowerInvariant(), out var root))
{
scheme.AccountKeyPath = new NBitcoin.KeyPath(root);
store.SetSupportedPaymentMethod(scheme);

View File

@ -238,8 +238,8 @@ namespace BTCPayServer.Services.Invoices
{
obj.Add(strat.PaymentId.ToString(), PaymentMethodExtensions.Serialize(strat));
#pragma warning disable CS0618
if (strat.PaymentId.IsBTCOnChain)
DerivationStrategy = ((JValue)PaymentMethodExtensions.Serialize(strat)).Value<string>();
// This field should eventually disappear
DerivationStrategy = null;
}
DerivationStrategies = JsonConvert.SerializeObject(obj);
#pragma warning restore CS0618