From 6addb3e481c180437b605337fdfa4abe1bb447ff Mon Sep 17 00:00:00 2001 From: Umar Bolatov Date: Sat, 7 Dec 2019 21:20:42 -0800 Subject: [PATCH] [Wallet] Show invalid address message when address is invalid fix #1217 --- BTCPayServer/Controllers/WalletsController.cs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/BTCPayServer/Controllers/WalletsController.cs b/BTCPayServer/Controllers/WalletsController.cs index 01d7b2161..dfd7628a6 100644 --- a/BTCPayServer/Controllers/WalletsController.cs +++ b/BTCPayServer/Controllers/WalletsController.cs @@ -395,7 +395,11 @@ namespace BTCPayServer.Controllers } catch { - ModelState.AddModelError(nameof(transactionOutput.DestinationAddress), "Invalid address"); + var inputName = + string.Format(CultureInfo.InvariantCulture, "Outputs[{0}].", i.ToString(CultureInfo.InvariantCulture)) + + nameof(transactionOutput.DestinationAddress); + + ModelState.AddModelError(inputName, "Invalid address"); } if (transactionOutput.Amount.HasValue) @@ -432,7 +436,7 @@ namespace BTCPayServer.Controllers } } - if (!ModelState.IsValid) + if (!ModelState.IsValid) return View(vm); DerivationSchemeSettings derivationScheme = GetDerivationSchemeSettings(walletId);