diff --git a/BTCPayServer.Common/BTCPayServer.Common.csproj b/BTCPayServer.Common/BTCPayServer.Common.csproj index bcba4d9db..8352ed422 100644 --- a/BTCPayServer.Common/BTCPayServer.Common.csproj +++ b/BTCPayServer.Common/BTCPayServer.Common.csproj @@ -4,7 +4,7 @@ - + diff --git a/BTCPayServer/Controllers/WalletsController.cs b/BTCPayServer/Controllers/WalletsController.cs index 39ff9102b..f01ab2d0d 100644 --- a/BTCPayServer/Controllers/WalletsController.cs +++ b/BTCPayServer/Controllers/WalletsController.cs @@ -489,8 +489,13 @@ namespace BTCPayServer.Controllers .ToArray(); var balance = _walletProvider.GetWallet(network).GetBalance(paymentMethod.AccountDerivation); model.NBXSeedAvailable = await GetSeed(walletId, network) != null; - model.CurrentBalance = (await balance).Total.GetValue(network); - + var Balance= await balance; + model.CurrentBalance = (Balance.Available ?? Balance.Total).GetValue(network); + if (Balance.Immature is null) + model.ImmatureBalance = 0; + else + model.ImmatureBalance = Balance.Immature.GetValue(network); + await Task.WhenAll(recommendedFees); model.RecommendedSatoshiPerByte = recommendedFees.Select(tuple => tuple.Result).Where(option => option != null).ToList(); diff --git a/BTCPayServer/Models/WalletViewModels/WalletSendModel.cs b/BTCPayServer/Models/WalletViewModels/WalletSendModel.cs index 4b04d0767..5e8b60423 100644 --- a/BTCPayServer/Models/WalletViewModels/WalletSendModel.cs +++ b/BTCPayServer/Models/WalletViewModels/WalletSendModel.cs @@ -35,6 +35,7 @@ namespace BTCPayServer.Models.WalletViewModels public bool SubtractFeesFromOutput { get; set; } } public decimal CurrentBalance { get; set; } + public decimal ImmatureBalance { get; set; } public string CryptoCode { get; set; } diff --git a/BTCPayServer/Views/Wallets/WalletSend.cshtml b/BTCPayServer/Views/Wallets/WalletSend.cshtml index 444d75e46..c3d1c8d23 100644 --- a/BTCPayServer/Views/Wallets/WalletSend.cshtml +++ b/BTCPayServer/Views/Wallets/WalletSend.cshtml @@ -33,6 +33,7 @@ + @@ -79,8 +80,12 @@

- Your current balance is + Your available balance is @Model.CryptoCode. + @if (Model.ImmatureBalance>0) + { +
Note: @Model.ImmatureBalance @Model.CryptoCode are still immature and require additional confirmations.
+ }

} @@ -109,6 +114,10 @@

Your current balance is @Model.CryptoCode. + @if (Model.ImmatureBalance > 0) + { +
Note: @Model.ImmatureBalance @Model.CryptoCode are still immature and require additional confirmations.
+ }