Do not include maxadditionalfeecontribution if there is no change. (#2007)

This commit is contained in:
nicolas.dorier 2020-10-23 11:57:06 +09:00
parent 58f0ca3d8a
commit 067b977ec8
No known key found for this signature in database
GPG Key ID: 6618763EF09186FE

View File

@ -109,10 +109,11 @@ namespace BTCPayServer.Services
if (!signedPSBT.TryGetEstimatedFeeRate(out var originalFeeRate))
throw new ArgumentException("signedPSBT should have utxo information", nameof(signedPSBT));
var originalFee = signedPSBT.GetFee();
optionalParameters.MaxAdditionalFeeContribution = MaxFeeBumpContribution is null ?
// By default, we want to keep same fee rate and a single additional input
originalFeeRate.GetFee(GetVirtualSize(inputScriptType)) :
MaxFeeBumpContribution;
if (changeOutput is PSBTOutput)
optionalParameters.MaxAdditionalFeeContribution = MaxFeeBumpContribution is null ?
// By default, we want to keep same fee rate and a single additional input
originalFeeRate.GetFee(GetVirtualSize(inputScriptType)) :
MaxFeeBumpContribution;
if (MinimumFeeRate is FeeRate v)
optionalParameters.MinFeeRate = v;