mirror of
https://github.com/aljazceru/btcpayserver.git
synced 2025-12-17 14:04:26 +01:00
Fix multi send substract fees
This commit is contained in:
@@ -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");
|
||||
|
||||
@@ -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" />
|
||||
|
||||
Reference in New Issue
Block a user