Skip to content
Permalink
Browse files

Merge pull request #2144 from yahiheb/sat-per-byte

Replace satoshi/byte & /bytes by sat/byte & /byte
  • Loading branch information...
lontivero committed Aug 22, 2019
2 parents 66acff2 + 62810a8 commit 7c713b6f54488b062ea21835484f9ec363fde128
@@ -85,7 +85,7 @@ public async Task<IActionResult> GetFeesAsync(string confirmationTargets)

foreach (int target in confirmationTargetsInts)
{
// 1. Use the sanity check that under 2 satoshi per bytes should not be displayed. To correct possible rounding errors.
// 1. Use the sanity check that under 2 satoshi per byte should not be displayed. To correct possible rounding errors.
// 2. Use the RPCResponse.Blocks output to avoid redundant RPC queries.
// 3. Use caching.
var conservativeResponse = await GetEstimateSmartFeeAsync(target, EstimateSmartFeeMode.Conservative);
@@ -3,7 +3,7 @@
namespace WalletWasabi.Backend.Models
{
/// <summary>
/// Satoshi per bytes.
/// Satoshi per byte.
/// </summary>
public class FeeEstimationPair
{
@@ -104,11 +104,11 @@ public static async Task<EstimateSmartFeeResponse> TryEstimateSmartFeeAsync(this

private static EstimateSmartFeeResponse SimulateRegTestFeeEstimation(int confirmationTarget, EstimateSmartFeeMode estimateMode)
{
int satoshiPerBytes = estimateMode == EstimateSmartFeeMode.Conservative
int satoshiPerByte = estimateMode == EstimateSmartFeeMode.Conservative
? (Constants.SevenDaysConfirmationTarget + 1 + 6 - confirmationTarget) / 7
: (Constants.SevenDaysConfirmationTarget + 1 + 5 - confirmationTarget) / 7; // Economical

Money feePerK = Money.Satoshis(satoshiPerBytes * 1000);
Money feePerK = Money.Satoshis(satoshiPerByte * 1000);
FeeRate feeRate = new FeeRate(feePerK);
var resp = new EstimateSmartFeeResponse { Blocks = confirmationTarget, FeeRate = feeRate };
return resp;
@@ -16,7 +16,7 @@ public class AllFeeEstimate : IEquatable<AllFeeEstimate>
public EstimateSmartFeeMode Type { get; }

/// <summary>
/// int: fee target, decimal: satoshi/bytes
/// int: fee target, decimal: satoshi/byte
/// </summary>
[JsonProperty]
public Dictionary<int, int> Estimations { get; }
@@ -1075,7 +1075,7 @@ public async Task BroadcastCoinJoinIfFullySignedAsync()
Logger.LogInfo<CcjRound>($"Round ({RoundId}): Network Fee: {networkFee.ToString(false, false)} BTC.");
Logger.LogInfo<CcjRound>($"Round ({RoundId}): Coordinator Fee: {SignedCoinJoin.Outputs.SingleOrDefault(x => x.ScriptPubKey == Constants.GetCoordinatorAddress(Network).ScriptPubKey)?.Value?.ToString(false, false) ?? "0"} BTC.");
FeeRate feeRate = SignedCoinJoin.GetFeeRate(spentCoins);
Logger.LogInfo<CcjRound>($"Round ({RoundId}): Network Fee Rate: {feeRate.FeePerK.ToDecimal(MoneyUnit.Satoshi) / 1000} satoshi/byte.");
Logger.LogInfo<CcjRound>($"Round ({RoundId}): Network Fee Rate: {feeRate.FeePerK.ToDecimal(MoneyUnit.Satoshi) / 1000} sat/byte.");
Logger.LogInfo<CcjRound>($"Round ({RoundId}): Number of inputs: {SignedCoinJoin.Inputs.Count}.");
Logger.LogInfo<CcjRound>($"Round ({RoundId}): Number of outputs: {SignedCoinJoin.Outputs.Count}.");
Logger.LogInfo<CcjRound>($"Round ({RoundId}): Serialized Size: {SignedCoinJoin.GetSerializedSize() / 1024} KB.");

0 comments on commit 7c713b6

Please sign in to comment.
You can’t perform that action at this time.