Add Wallet settings menu, do not rebase keypaths when create the PSBT

This commit is contained in:
nicolas.dorier
2019-05-13 00:13:55 +09:00
parent 698033b0cf
commit bf37f44795
14 changed files with 338 additions and 37 deletions

View File

@@ -0,0 +1,32 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Threading.Tasks;
using NBitcoin;
using NBitcoin.DataEncoders;
namespace BTCPayServer.Validation
{
public class HDFingerPrintValidator : ValidationAttribute
{
protected override ValidationResult IsValid(object value, ValidationContext validationContext)
{
var str = value as string;
if (string.IsNullOrWhiteSpace(str))
{
return ValidationResult.Success;
}
try
{
new HDFingerprint(Encoders.Hex.DecodeData(str));
return ValidationResult.Success;
}
catch
{
return new ValidationResult("Invalid fingerprint");
}
}
}
}