Restore sanity fee rate and nits
MODIFY
WalletWasabi.Tests/UnitTests/AllFeeEstimateTests.cs
WalletWasabi.Tests/UnitTests/AllFeeEstimateTests.cs
@@ -117,10 +117,10 @@ namespace WalletWasabi.Tests.UnitTests
{
var rpc = new MockRpcClient();
rpc.OnGetBlockchainInfoAsync = () =>
- throw new RPCException(RPCErrorCode.RPC_CLIENT_NOT_CONNECTED, "Error", null);
+ throw new RPCException(RPCErrorCode.RPC_CLIENT_NOT_CONNECTED, "Error-GetBlockchainInfo", null);
rpc.OnEstimateSmartFeeAsync = (target, _) =>
- throw new RPCException(RPCErrorCode.RPC_CLIENT_NOT_CONNECTED, "Error", null);
+ throw new RPCException(RPCErrorCode.RPC_CLIENT_NOT_CONNECTED, "Error-EstimateSmartFee", null);
rpc.OnGetMempoolInfoAsync = async () =>
await Task.FromResult(new MemPoolInfo
@@ -130,7 +130,7 @@ namespace WalletWasabi.Tests.UnitTests
var ex = await Assert.ThrowsAsync<RPCException>(async () => await rpc.EstimateAllFeeAsync(EstimateSmartFeeMode.Conservative));
Assert.Equal(RPCErrorCode.RPC_CLIENT_NOT_CONNECTED, ex.RPCCode);
- Assert.Equal("Error", ex.Message);
+ Assert.Equal("Error-EstimateSmartFee", ex.Message);
}
[Fact]

MODIFY
WalletWasabi/Extensions/RPCClientExtensions.cs
WalletWasabi/Extensions/RPCClientExtensions.cs
@@ -69,15 +69,17 @@ namespace NBitcoin.RPC
/// </summary>
public static async Task<AllFeeEstimate> EstimateAllFeeAsync(this IRPCClient rpc, EstimateSmartFeeMode estimateMode = EstimateSmartFeeMode.Conservative, bool simulateIfRegTest = false)
{
- var rpcStatus = await rpc.GetRpcStatusAsync(CancellationToken.None).ConfigureAwait(false);
-
var estimations = (simulateIfRegTest && rpc.Network == Network.RegTest)
? SimulateRegTestFeeEstimation(estimateMode)
: await GetFeeEstimationsAsync(rpc, estimateMode).ConfigureAwait(false);
+ var rpcStatus = await rpc.GetRpcStatusAsync(CancellationToken.None).ConfigureAwait(false);
+ var mempoolInfo = await rpc.GetMempoolInfoAsync().ConfigureAwait(false);
+ var sanityFeeRate = mempoolInfo.GetSanityFeeRate();
+
return new AllFeeEstimate(
estimateMode,
- estimations,
+ estimations.ToDictionary(x => x.Key, x => Math.Max(x.Value, (int)sanityFeeRate.SatoshiPerByte)),
rpcStatus.Synchronized);
}

Restore sanity fee rate and nits