Remove randomize RBF from wallet UI advanced settings (#5709)

* Remove randomize RBF from wallet UI advanced settings

* remove support RBF and allow bump fee from wallet send model

* update psbt RBF
This commit is contained in:
Chukwuleta Tobechi 2024-01-31 13:04:19 +01:00 committed by GitHub
parent 6290b0f3bf
commit a8fdc4798d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 2 additions and 33 deletions

View file

@ -518,10 +518,6 @@ namespace BTCPayServer.Controllers.Greenfield
Outputs = outputs, Outputs = outputs,
AlwaysIncludeNonWitnessUTXO = true, AlwaysIncludeNonWitnessUTXO = true,
InputSelection = request.SelectedInputs?.Any() is true, InputSelection = request.SelectedInputs?.Any() is true,
AllowFeeBump =
!request.RBF.HasValue ? WalletSendModel.ThreeStateBool.Maybe :
request.RBF.Value ? WalletSendModel.ThreeStateBool.Yes :
WalletSendModel.ThreeStateBool.No,
FeeSatoshiPerByte = request.FeeRate?.SatoshiPerByte, FeeSatoshiPerByte = request.FeeRate?.SatoshiPerByte,
NoChange = request.NoChange NoChange = request.NoChange
}, },

View file

@ -42,15 +42,7 @@ namespace BTCPayServer.Controllers
psbtDestination.Amount = Money.Coins(transactionOutput.Amount.Value); psbtDestination.Amount = Money.Coins(transactionOutput.Amount.Value);
psbtDestination.SubstractFees = transactionOutput.SubtractFeesFromOutput; psbtDestination.SubstractFees = transactionOutput.SubtractFeesFromOutput;
} }
psbtRequest.RBF = network.SupportRBF ? true : null;
if (network.SupportRBF)
{
if (sendModel.AllowFeeBump is WalletSendModel.ThreeStateBool.Yes)
psbtRequest.RBF = true;
if (sendModel.AllowFeeBump is WalletSendModel.ThreeStateBool.No)
psbtRequest.RBF = false;
}
psbtRequest.AlwaysIncludeNonWitnessUTXO = sendModel.AlwaysIncludeNonWitnessUTXO; psbtRequest.AlwaysIncludeNonWitnessUTXO = sendModel.AlwaysIncludeNonWitnessUTXO;
psbtRequest.FeePreference = new FeePreference(); psbtRequest.FeePreference = new FeePreference();

View file

@ -513,8 +513,6 @@ namespace BTCPayServer.Controllers
recommendedFees.Select(tuple => tuple.GetAwaiter().GetResult()).Where(option => option != null).ToList(); recommendedFees.Select(tuple => tuple.GetAwaiter().GetResult()).Where(option => option != null).ToList();
model.FeeSatoshiPerByte = recommendedFees[1].GetAwaiter().GetResult()?.FeeRate; model.FeeSatoshiPerByte = recommendedFees[1].GetAwaiter().GetResult()?.FeeRate;
model.SupportRBF = network.SupportRBF;
model.CryptoDivisibility = network.Divisibility; model.CryptoDivisibility = network.Divisibility;
using (CancellationTokenSource cts = new CancellationTokenSource()) using (CancellationTokenSource cts = new CancellationTokenSource())
{ {
@ -570,7 +568,6 @@ namespace BTCPayServer.Controllers
if (network == null || network.ReadonlyWallet) if (network == null || network.ReadonlyWallet)
return NotFound(); return NotFound();
vm.SupportRBF = network.SupportRBF;
vm.NBXSeedAvailable = await GetSeed(walletId, network) != null; vm.NBXSeedAvailable = await GetSeed(walletId, network) != null;
if (!string.IsNullOrEmpty(bip21)) if (!string.IsNullOrEmpty(bip21))
{ {

View file

@ -55,11 +55,8 @@ namespace BTCPayServer.Models.WalletViewModels
public int CryptoDivisibility { get; set; } public int CryptoDivisibility { get; set; }
public string Fiat { get; set; } public string Fiat { get; set; }
public string RateError { get; set; } public string RateError { get; set; }
public bool SupportRBF { get; set; }
[Display(Name = "Always include non-witness UTXO if available")] [Display(Name = "Always include non-witness UTXO if available")]
public bool AlwaysIncludeNonWitnessUTXO { get; set; } public bool AlwaysIncludeNonWitnessUTXO { get; set; }
[Display(Name = "Allow fee increase (RBF)")]
public ThreeStateBool AllowFeeBump { get; set; }
public bool NBXSeedAvailable { get; set; } public bool NBXSeedAvailable { get; set; }
[Display(Name = "PayJoin BIP21")] [Display(Name = "PayJoin BIP21")]

View file

@ -271,20 +271,7 @@
<label asp-for="AlwaysIncludeNonWitnessUTXO" class="form-check-label"></label> <label asp-for="AlwaysIncludeNonWitnessUTXO" class="form-check-label"></label>
</div> </div>
</div> </div>
@if (Model.SupportRBF)
{
<div class="form-group">
<label asp-for="AllowFeeBump" class="form-label"></label>
<a href="https://docs.btcpayserver.org/Wallet/#rbf-replace-by-fee" target="_blank" rel="noreferrer noopener">
<vc:icon symbol="info" />
</a>
<select asp-for="AllowFeeBump" class="form-select w-auto">
<option value="Maybe">Randomize for higher privacy</option>
<option value="Yes">Yes</option>
<option value="No">No</option>
</select>
</div>
}
@if (!string.IsNullOrEmpty(Model.PayJoinBIP21)) @if (!string.IsNullOrEmpty(Model.PayJoinBIP21))
{ {
<div class="form-group"> <div class="form-group">