diff --git a/NBitcoin/RPC/RPCClient.cs b/NBitcoin/RPC/RPCClient.cs index 88d090fa2..24f35b90f 100644 --- a/NBitcoin/RPC/RPCClient.cs +++ b/NBitcoin/RPC/RPCClient.cs @@ -2060,7 +2060,7 @@ public async Task BumpFeeAsync(uint256 txid, CancellationToken can /// Whether to return a more conservative estimate which also satisfies a longer history. A conservative estimate potentially returns a higher feerate and is more likely to be sufficient for the desired target, but is not as responsive to short term drops in the prevailing fee market. /// The estimated fee rate, block number where estimate was found /// The Fee rate couldn't be estimated because of insufficient data from Bitcoin Core - public EstimateSmartFeeResponse EstimateSmartFee(int confirmationTarget, EstimateSmartFeeMode estimateMode = EstimateSmartFeeMode.Conservative) + public EstimateSmartFeeResponse EstimateSmartFee(int confirmationTarget, EstimateSmartFeeMode? estimateMode = null) { return EstimateSmartFeeAsync(confirmationTarget, estimateMode).GetAwaiter().GetResult(); } @@ -2072,7 +2072,7 @@ public EstimateSmartFeeResponse EstimateSmartFee(int confirmationTarget, Estimat /// Confirmation target in blocks (1 - 1008) /// Whether to return a more conservative estimate which also satisfies a longer history. A conservative estimate potentially returns a higher feerate and is more likely to be sufficient for the desired target, but is not as responsive to short term drops in the prevailing fee market. /// The estimated fee rate, block number where estimate was found or null - public async Task TryEstimateSmartFeeAsync(int confirmationTarget, EstimateSmartFeeMode estimateMode = EstimateSmartFeeMode.Conservative, CancellationToken cancellationToken = default) + public async Task TryEstimateSmartFeeAsync(int confirmationTarget, EstimateSmartFeeMode? estimateMode = null, CancellationToken cancellationToken = default) { return await EstimateSmartFeeImplAsync(confirmationTarget, estimateMode, cancellationToken).ConfigureAwait(false); } @@ -2084,7 +2084,7 @@ public async Task TryEstimateSmartFeeAsync(int confirm /// Confirmation target in blocks (1 - 1008) /// Whether to return a more conservative estimate which also satisfies a longer history. A conservative estimate potentially returns a higher feerate and is more likely to be sufficient for the desired target, but is not as responsive to short term drops in the prevailing fee market. /// The estimated fee rate, block number where estimate was found or null - public EstimateSmartFeeResponse TryEstimateSmartFee(int confirmationTarget, EstimateSmartFeeMode estimateMode = EstimateSmartFeeMode.Conservative) + public EstimateSmartFeeResponse TryEstimateSmartFee(int confirmationTarget, EstimateSmartFeeMode? estimateMode = null) { return TryEstimateSmartFeeAsync(confirmationTarget, estimateMode).GetAwaiter().GetResult(); } @@ -2097,7 +2097,7 @@ public EstimateSmartFeeResponse TryEstimateSmartFee(int confirmationTarget, Esti /// Whether to return a more conservative estimate which also satisfies a longer history. A conservative estimate potentially returns a higher feerate and is more likely to be sufficient for the desired target, but is not as responsive to short term drops in the prevailing fee market. /// The estimated fee rate, block number where estimate was found /// when fee couldn't be estimated - public async Task EstimateSmartFeeAsync(int confirmationTarget, EstimateSmartFeeMode estimateMode = EstimateSmartFeeMode.Conservative, CancellationToken cancellationToken = default) + public async Task EstimateSmartFeeAsync(int confirmationTarget, EstimateSmartFeeMode? estimateMode = null, CancellationToken cancellationToken = default) { var feeRate = await EstimateSmartFeeImplAsync(confirmationTarget, estimateMode, cancellationToken); if (feeRate == null) @@ -2108,12 +2108,12 @@ public async Task EstimateSmartFeeAsync(int confirmati /// /// (>= Bitcoin Core v0.14) /// - private async Task EstimateSmartFeeImplAsync(int confirmationTarget, EstimateSmartFeeMode estimateMode = EstimateSmartFeeMode.Conservative, CancellationToken cancellationToken = default) + private async Task EstimateSmartFeeImplAsync(int confirmationTarget, EstimateSmartFeeMode? estimateMode = null, CancellationToken cancellationToken = default) { if (Capabilities == null || Capabilities.SupportEstimateSmartFee) { var parameters = new List() { confirmationTarget }; - if (estimateMode != EstimateSmartFeeMode.Conservative) + if (estimateMode != null) { parameters.Add(estimateMode.ToString().ToUpperInvariant()); }