Randomize RBF if the user does not care

This commit is contained in:
nicolas.dorier 2020-05-24 21:11:33 +09:00
parent 32f2acee53
commit 36630d9586
No known key found for this signature in database
GPG Key ID: 6618763EF09186FE
3 changed files with 28 additions and 13 deletions

View File

@ -40,7 +40,10 @@ namespace BTCPayServer.Controllers
if (network.SupportRBF)
{
psbtRequest.RBF = !sendModel.DisableRBF;
if (sendModel.AllowFeeBump is WalletSendModel.ThreeStateBool.Yes)
psbtRequest.RBF = true;
if (sendModel.AllowFeeBump is WalletSendModel.ThreeStateBool.No)
psbtRequest.RBF = false;
}
psbtRequest.FeePreference = new FeePreference();

View File

@ -7,6 +7,12 @@ namespace BTCPayServer.Models.WalletViewModels
{
public class WalletSendModel
{
public enum ThreeStateBool
{
Maybe,
Yes,
No
}
public class FeeRateOption
{
public TimeSpan Target { get; set; }
@ -45,8 +51,8 @@ namespace BTCPayServer.Models.WalletViewModels
public string Fiat { get; set; }
public string RateError { get; set; }
public bool SupportRBF { get; set; }
[Display(Name = "Disable RBF")]
public bool DisableRBF { get; set; }
[Display(Name = "Allow fee increase (RBF)")]
public ThreeStateBool AllowFeeBump { get; set; }
public bool NBXSeedAvailable { get; set; }
[Display(Name = "PayJoin Endpoint Url")]

View File

@ -171,21 +171,27 @@
</button>
<div id="accordian-advanced" class="collapse" aria-labelledby="accordian-advanced-header" data-parent="#accordian-advanced">
<div class="card-body">
<div class="form-check">
<input asp-for="NoChange" class="form-check-input" />
<label asp-for="NoChange" class="form-check-label"></label>
<a href="https://docs.btcpayserver.org/features/wallet#make-sure-no-change-utxo-is-created-expert-mode" target="_blank">
<span class="fa fa-question-circle-o" title="More information..."></span>
</a>
<div class="form-group">
<div class="form-check">
<input asp-for="NoChange" class="form-check-input" />
<label asp-for="NoChange" class="form-check-label"></label>
<a href="https://docs.btcpayserver.org/features/wallet#make-sure-no-change-utxo-is-created-expert-mode" target="_blank">
<span class="fa fa-question-circle-o" title="More information..."></span>
</a>
</div>
</div>
@if (Model.SupportRBF)
{
<div class="form-check">
<input asp-for="DisableRBF" class="form-check-input" />
<label asp-for="DisableRBF" class="form-check-label"></label>
<a href="https://bitcoin.org/en/glossary/rbf" target="_blank">
<div class="form-group">
<label asp-for="AllowFeeBump"></label>
<a href="https://bitcoinops.org/en/rbf-in-the-wild/" target="_blank">
<span class="fa fa-question-circle-o" title="More information..."></span>
</a>
<select asp-for="AllowFeeBump" class="form-control">
<option value="Maybe">Randomize for higher privacy</option>
<option value="Yes">Yes</option>
<option value="No">No</option>
</select>
</div>
}
@if (!string.IsNullOrEmpty(Model.PayJoinEndpointUrl))