Fix parse hex as uint.
MODIFY
WalletWasabi.Gui/Tabs/WalletManager/LoadWalletViewModel.cs
WalletWasabi.Gui/Tabs/WalletManager/LoadWalletViewModel.cs
@@ -126,8 +126,12 @@ namespace WalletWasabi.Gui.Tabs.WalletManager
reverseByteOrder = true;
}
}
- HDFingerprint mfp = NBitcoinHelpers.BetterParseHDFingerprint(mfpString, reverseByteOrder: reverseByteOrder);
+
+ var bytes = ByteHelpers.FromHex(Guard.NotNullOrEmptyOrWhitespace(nameof(mfpString), mfpString, trim: true));
+ HDFingerprint mfp = reverseByteOrder ? new HDFingerprint(bytes.Reverse().ToArray()) : new HDFingerprint(bytes);
+
ExtPubKey extPubKey = NBitcoinHelpers.BetterParseExtPubKey(xpubString);
+
Logger.LogInfo("Creating a new wallet file.");
var walletName = Global.GetNextHardwareWalletName(customPrefix: "Coldcard");
var walletFullPath = Global.GetWalletFullPath(walletName);

MODIFY
WalletWasabi/Helpers/NBitcoinHelpers.cs
WalletWasabi/Helpers/NBitcoinHelpers.cs
@@ -115,25 +115,6 @@ namespace WalletWasabi.Helpers
return ba;
}
- public static HDFingerprint BetterParseHDFingerprint(string hdFingerprintString, bool reverseByteOrder = false)
- {
- hdFingerprintString = Guard.NotNullOrEmptyOrWhitespace(nameof(hdFingerprintString), hdFingerprintString, trim: true);
-
- HDFingerprint hdfp;
- try
- {
- var hdfpu = uint.Parse(hdFingerprintString);
- hdfp = new HDFingerprint(hdfpu);
- }
- catch
- {
- // Try hex, Old wallet format was like this.
- var bytes = ByteHelpers.FromHex(hdFingerprintString);
- hdfp = reverseByteOrder ? new HDFingerprint(bytes.Reverse().ToArray()) : new HDFingerprint(bytes);
- }
- return hdfp;
- }
-
public static async Task<AddressManager> LoadAddressManagerFromPeerFileAsync(string filePath, Network expectedNetwork = null)
{
byte[] data, hash;

Fix parse hex as uint.