fix: parse fee rate with the invariant culture
On Italian/German systems "1.5" was read as 15 sat/vB. The Send form, the Donate form and the CLI now share CoinAmount.TryParseFeeRate (invariant culture, '.' or ',' as decimal separator, range (0, 1000]). Donate and the CLI report an invalid rate instead of silently using 1.
This commit is contained in:
1 parent
d431996ddc
commit
cb551efce4
7 files changed
+99
-7
No files matched your search
@@ -44,9 +44,11 @@ public partial class MainWindowViewModel
|
||||
DonatePreview = Loc.Tr("msg.amount.invalid");
|
||||
return;
|
||||
}
|
||||
if (!decimal.TryParse(SendFeeRate, System.Globalization.NumberStyles.Any,
|
||||
System.Globalization.CultureInfo.InvariantCulture, out var feeRate) || feeRate <= 0)
|
||||
feeRate = 1m;
|
||||
if (!CoinAmount.TryParseFeeRate(SendFeeRate, out var feeRate))
|
||||
{
|
||||
DonatePreview = Loc.Tr("msg.feerate.invalid");
|
||||
return;
|
||||
}
|
||||
|
||||
_pendingDonate = new TransactionFactory(_account).Build(
|
||||
_doc.Cache.Utxos, _lastTransactions, destination, amount, feeRate,
|
||||
|
||||
@@ -74,7 +74,7 @@ public partial class MainWindowViewModel
|
||||
SendPreview = Loc.Tr("msg.amount.invalid");
|
||||
return;
|
||||
}
|
||||
if (!decimal.TryParse(SendFeeRate, out var feeRate) || feeRate <= 0)
|
||||
if (!CoinAmount.TryParseFeeRate(SendFeeRate, out var feeRate))
|
||||
{
|
||||
SendPreview = Loc.Tr("msg.feerate.invalid");
|
||||
return;
|
||||
|
||||
Reference in new issue
Block a user