mirror of
https://github.com/btcpayserver/btcpayserver.git
synced 2025-02-22 14:22:40 +01:00
Merge pull request #1596 from NicolasDorier/random-rbf
Randomize RBF if the user does not care
This commit is contained in:
commit
5b4fec11ed
3 changed files with 28 additions and 13 deletions
|
@ -40,7 +40,10 @@ namespace BTCPayServer.Controllers
|
||||||
|
|
||||||
if (network.SupportRBF)
|
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();
|
psbtRequest.FeePreference = new FeePreference();
|
||||||
|
|
|
@ -7,6 +7,12 @@ namespace BTCPayServer.Models.WalletViewModels
|
||||||
{
|
{
|
||||||
public class WalletSendModel
|
public class WalletSendModel
|
||||||
{
|
{
|
||||||
|
public enum ThreeStateBool
|
||||||
|
{
|
||||||
|
Maybe,
|
||||||
|
Yes,
|
||||||
|
No
|
||||||
|
}
|
||||||
public class FeeRateOption
|
public class FeeRateOption
|
||||||
{
|
{
|
||||||
public TimeSpan Target { get; set; }
|
public TimeSpan Target { get; set; }
|
||||||
|
@ -45,8 +51,8 @@ namespace BTCPayServer.Models.WalletViewModels
|
||||||
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; }
|
public bool SupportRBF { get; set; }
|
||||||
[Display(Name = "Disable RBF")]
|
[Display(Name = "Allow fee increase (RBF)")]
|
||||||
public bool DisableRBF { get; set; }
|
public ThreeStateBool AllowFeeBump { get; set; }
|
||||||
|
|
||||||
public bool NBXSeedAvailable { get; set; }
|
public bool NBXSeedAvailable { get; set; }
|
||||||
[Display(Name = "PayJoin Endpoint Url")]
|
[Display(Name = "PayJoin Endpoint Url")]
|
||||||
|
|
|
@ -171,21 +171,27 @@
|
||||||
</button>
|
</button>
|
||||||
<div id="accordian-advanced" class="collapse" aria-labelledby="accordian-advanced-header" data-parent="#accordian-advanced">
|
<div id="accordian-advanced" class="collapse" aria-labelledby="accordian-advanced-header" data-parent="#accordian-advanced">
|
||||||
<div class="card-body">
|
<div class="card-body">
|
||||||
<div class="form-check">
|
<div class="form-group">
|
||||||
<input asp-for="NoChange" class="form-check-input" />
|
<div class="form-check">
|
||||||
<label asp-for="NoChange" class="form-check-label"></label>
|
<input asp-for="NoChange" class="form-check-input" />
|
||||||
<a href="https://docs.btcpayserver.org/features/wallet#make-sure-no-change-utxo-is-created-expert-mode" target="_blank">
|
<label asp-for="NoChange" class="form-check-label"></label>
|
||||||
<span class="fa fa-question-circle-o" title="More information..."></span>
|
<a href="https://docs.btcpayserver.org/features/wallet#make-sure-no-change-utxo-is-created-expert-mode" target="_blank">
|
||||||
</a>
|
<span class="fa fa-question-circle-o" title="More information..."></span>
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@if (Model.SupportRBF)
|
@if (Model.SupportRBF)
|
||||||
{
|
{
|
||||||
<div class="form-check">
|
<div class="form-group">
|
||||||
<input asp-for="DisableRBF" class="form-check-input" />
|
<label asp-for="AllowFeeBump"></label>
|
||||||
<label asp-for="DisableRBF" class="form-check-label"></label>
|
<a href="https://bitcoinops.org/en/rbf-in-the-wild/" target="_blank">
|
||||||
<a href="https://bitcoin.org/en/glossary/rbf" target="_blank">
|
|
||||||
<span class="fa fa-question-circle-o" title="More information..."></span>
|
<span class="fa fa-question-circle-o" title="More information..."></span>
|
||||||
</a>
|
</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>
|
</div>
|
||||||
}
|
}
|
||||||
@if (!string.IsNullOrEmpty(Model.PayJoinEndpointUrl))
|
@if (!string.IsNullOrEmpty(Model.PayJoinEndpointUrl))
|
||||||
|
|
Loading…
Add table
Reference in a new issue