Skip to content

Commit c53b096

Browse files
Merge pull request #1264 from MetacoSA/incorrect-fee-estimation
Incorrect fee estimation - Backport to v7.0.42
2 parents 4c5b2ac + c7d63c1 commit c53b096

File tree

3 files changed

+11
-7
lines changed

3 files changed

+11
-7
lines changed

.github/workflows/master.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,10 @@ jobs:
2323
runs-on: ubuntu-latest
2424
steps:
2525
- uses: actions/checkout@v2
26+
- name: Install libssl
27+
run: |
28+
wget http://archive.ubuntu.com/ubuntu/pool/main/o/openssl1.0/libssl1.0.0_1.0.2n-1ubuntu5_amd64.deb
29+
sudo dpkg -i libssl1.0.0_1.0.2n-1ubuntu5_amd64.deb
2630
- uses: actions/setup-dotnet@v1
2731
with:
2832
dotnet-version: '6.0.x'

NBitcoin/NBitcoin.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
<RepositoryType>git</RepositoryType>
1313
</PropertyGroup>
1414
<PropertyGroup>
15-
<Version Condition=" '$(Version)' == '' ">7.0.42</Version>
15+
<Version Condition=" '$(Version)' == '' ">7.0.42.1</Version>
1616
<LangVersion>9.0</LangVersion>
1717
</PropertyGroup>
1818
<PropertyGroup Condition=" '$(Configuration)' == 'Release' ">

NBitcoin/RPC/RPCClient.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2029,7 +2029,7 @@ public async Task<BumpResponse> BumpFeeAsync(uint256 txid, CancellationToken can
20292029
/// <param name="estimateMode">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.</param>
20302030
/// <returns>The estimated fee rate, block number where estimate was found</returns>
20312031
/// <exception cref="NoEstimationException">The Fee rate couldn't be estimated because of insufficient data from Bitcoin Core</exception>
2032-
public EstimateSmartFeeResponse EstimateSmartFee(int confirmationTarget, EstimateSmartFeeMode estimateMode = EstimateSmartFeeMode.Conservative)
2032+
public EstimateSmartFeeResponse EstimateSmartFee(int confirmationTarget, EstimateSmartFeeMode? estimateMode = null)
20332033
{
20342034
return EstimateSmartFeeAsync(confirmationTarget, estimateMode).GetAwaiter().GetResult();
20352035
}
@@ -2041,7 +2041,7 @@ public EstimateSmartFeeResponse EstimateSmartFee(int confirmationTarget, Estimat
20412041
/// <param name="confirmationTarget">Confirmation target in blocks (1 - 1008)</param>
20422042
/// <param name="estimateMode">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.</param>
20432043
/// <returns>The estimated fee rate, block number where estimate was found or null</returns>
2044-
public async Task<EstimateSmartFeeResponse> TryEstimateSmartFeeAsync(int confirmationTarget, EstimateSmartFeeMode estimateMode = EstimateSmartFeeMode.Conservative, CancellationToken cancellationToken = default)
2044+
public async Task<EstimateSmartFeeResponse> TryEstimateSmartFeeAsync(int confirmationTarget, EstimateSmartFeeMode? estimateMode = null, CancellationToken cancellationToken = default)
20452045
{
20462046
return await EstimateSmartFeeImplAsync(confirmationTarget, estimateMode, cancellationToken).ConfigureAwait(false);
20472047
}
@@ -2053,7 +2053,7 @@ public async Task<EstimateSmartFeeResponse> TryEstimateSmartFeeAsync(int confirm
20532053
/// <param name="confirmationTarget">Confirmation target in blocks (1 - 1008)</param>
20542054
/// <param name="estimateMode">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.</param>
20552055
/// <returns>The estimated fee rate, block number where estimate was found or null</returns>
2056-
public EstimateSmartFeeResponse TryEstimateSmartFee(int confirmationTarget, EstimateSmartFeeMode estimateMode = EstimateSmartFeeMode.Conservative)
2056+
public EstimateSmartFeeResponse TryEstimateSmartFee(int confirmationTarget, EstimateSmartFeeMode? estimateMode = null)
20572057
{
20582058
return TryEstimateSmartFeeAsync(confirmationTarget, estimateMode).GetAwaiter().GetResult();
20592059
}
@@ -2066,7 +2066,7 @@ public EstimateSmartFeeResponse TryEstimateSmartFee(int confirmationTarget, Esti
20662066
/// <param name="estimateMode">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.</param>
20672067
/// <returns>The estimated fee rate, block number where estimate was found</returns>
20682068
/// <exception cref="NoEstimationException">when fee couldn't be estimated</exception>
2069-
public async Task<EstimateSmartFeeResponse> EstimateSmartFeeAsync(int confirmationTarget, EstimateSmartFeeMode estimateMode = EstimateSmartFeeMode.Conservative, CancellationToken cancellationToken = default)
2069+
public async Task<EstimateSmartFeeResponse> EstimateSmartFeeAsync(int confirmationTarget, EstimateSmartFeeMode? estimateMode = null, CancellationToken cancellationToken = default)
20702070
{
20712071
var feeRate = await EstimateSmartFeeImplAsync(confirmationTarget, estimateMode, cancellationToken);
20722072
if (feeRate == null)
@@ -2077,12 +2077,12 @@ public async Task<EstimateSmartFeeResponse> EstimateSmartFeeAsync(int confirmati
20772077
/// <summary>
20782078
/// (>= Bitcoin Core v0.14)
20792079
/// </summary>
2080-
private async Task<EstimateSmartFeeResponse> EstimateSmartFeeImplAsync(int confirmationTarget, EstimateSmartFeeMode estimateMode = EstimateSmartFeeMode.Conservative, CancellationToken cancellationToken = default)
2080+
private async Task<EstimateSmartFeeResponse> EstimateSmartFeeImplAsync(int confirmationTarget, EstimateSmartFeeMode? estimateMode = null, CancellationToken cancellationToken = default)
20812081
{
20822082
if (Capabilities == null || Capabilities.SupportEstimateSmartFee)
20832083
{
20842084
var parameters = new List<object>() { confirmationTarget };
2085-
if (estimateMode != EstimateSmartFeeMode.Conservative)
2085+
if (estimateMode != null)
20862086
{
20872087
parameters.Add(estimateMode.ToString().ToUpperInvariant());
20882088
}

0 commit comments

Comments
 (0)