Properly counting transactions that impact NetworkFee

This commit is contained in:
rockstardev
2021-07-06 00:43:49 +02:00
committed by Andrew Camilleri
parent edc9429e84
commit 48355129c5
3 changed files with 10 additions and 2 deletions

View File

@@ -557,6 +557,13 @@ namespace BTCPayServer.Controllers
RedirectAutomatically = invoice.RedirectAutomatically, RedirectAutomatically = invoice.RedirectAutomatically,
StoreName = store.StoreName, StoreName = store.StoreName,
TxCount = accounting.TxRequired, TxCount = accounting.TxRequired,
TxCountForFee = storeBlob.NetworkFeeMode switch
{
NetworkFeeMode.Always => accounting.TxRequired,
NetworkFeeMode.MultiplePaymentsOnly => accounting.TxRequired - 1,
NetworkFeeMode.Never => 0,
_ => throw new NotImplementedException()
},
BtcPaid = accounting.Paid.ShowMoney(divisibility), BtcPaid = accounting.Paid.ShowMoney(divisibility),
#pragma warning disable CS0618 // Type or member is obsolete #pragma warning disable CS0618 // Type or member is obsolete
Status = invoice.StatusString, Status = invoice.StatusString,

View File

@@ -49,6 +49,7 @@ namespace BTCPayServer.Models.InvoicingModels
public string InvoiceBitcoinUrl { get; set; } public string InvoiceBitcoinUrl { get; set; }
public string InvoiceBitcoinUrlQR { get; set; } public string InvoiceBitcoinUrlQR { get; set; }
public int TxCount { get; set; } public int TxCount { get; set; }
public int TxCountForFee { get; set; }
public string BtcPaid { get; set; } public string BtcPaid { get; set; }
public string StoreEmail { get; set; } public string StoreEmail { get; set; }

View File

@@ -1,4 +1,4 @@
@model PaymentModel @model PaymentModel
<div class="top-header"> <div class="top-header">
<div class="header"> <div class="header">
@@ -133,7 +133,7 @@
{{ srvModel.networkFee }} {{ srvModel.cryptoCode }} {{ srvModel.networkFee }} {{ srvModel.cryptoCode }}
</span> </span>
<span v-else> <span v-else>
{{$t("txCount", {count: srvModel.txCount})}} x {{ srvModel.networkFee }} {{ srvModel.cryptoCode }} {{$t("txCount", {count: srvModel.txCountForFee})}} x {{ srvModel.networkFee }} {{ srvModel.cryptoCode }}
</span> </span>
</div> </div>
</div> </div>