Fix multi send substract fees

This commit is contained in:
nicolas.dorier
2019-05-21 19:04:39 +09:00
parent 06a35787aa
commit 3bada5d443
2 changed files with 7 additions and 7 deletions

View File

@@ -247,7 +247,7 @@ namespace BTCPayServer.Controllers
}
var subtractFeesOutputsCount = new List<int>();
var substractFees = vm.Outputs.Any(o => o.SubtractFeesFromOutput);
for (var i = 0; i < vm.Outputs.Count; i++)
{
var transactionOutput = vm.Outputs[i];
@@ -278,7 +278,7 @@ namespace BTCPayServer.Controllers
vm.AddModelError(model => model.Outputs[subtractFeesOutput].SubtractFeesFromOutput,
"You can only subtract fees from one output", ModelState);
}
}else if (vm.CurrentBalance == transactionAmountSum && vm.Outputs.Count > 1)
}else if (vm.CurrentBalance == transactionAmountSum && !substractFees)
{
ModelState.AddModelError(string.Empty,
"You are sending your entire balance, you should subtract the fees from an output");

View File

@@ -60,6 +60,11 @@
<div class="list-group-item transaction-output-form p-0 pl-lg-2">
<div class="row">
<div class="col-sm-12 col-md-12 col-lg-10 py-2 ">
<div class="form-group">
<label asp-for="Outputs[index].DestinationAddress" class="control-label"></label>
<input asp-for="Outputs[index].DestinationAddress" class="form-control" />
<span asp-validation-for="Outputs[index].DestinationAddress" class="text-danger"></span>
</div>
<div class="form-group">
<label asp-for="Outputs[index].Amount" class="control-label"></label>
<div class="input-group">
@@ -74,11 +79,6 @@
</p>
<span asp-validation-for="Outputs[index].Amount" class="text-danger"></span>
</div>
<div class="form-group">
<label asp-for="Outputs[index].DestinationAddress" class="control-label"></label>
<input asp-for="Outputs[index].DestinationAddress" class="form-control" />
<span asp-validation-for="Outputs[index].DestinationAddress" class="text-danger"></span>
</div>
<div class="form-group">
<label asp-for="Outputs[index].SubtractFeesFromOutput" class="control-label"></label>
<input type="checkbox" asp-for="Outputs[index].SubtractFeesFromOutput" class="form-check subtract-fees" />