protected override async Task ActionAsync(CancellationToken cancel) { var feeRate = (await Rpc.EstimateSmartFeeAsync((int)Config.ConfirmationTarget, EstimateSmartFeeMode.Conservative, simulateIfRegTest: true, cancel).ConfigureAwait(false)).FeeRate; CoinJoinFeeRateStat feeRateStat = new(DateTimeOffset.UtcNow, Config.ConfirmationTarget, feeRate); Add(feeRateStat); NewStat?.Invoke(this, feeRateStat); }
/// <summary> /// Stores data from the bike in the stats dictionary /// </summary> /// <param name="sender"> object that send the data</param> /// <param name="e">command that was send</param> private void addStat(string data) { // switch to process return statements. if (data.Contains("ACK") || data.Contains("RUN") || data.Contains("ERROR")) { return; } var statE = new BikeStatEvent(BikeStatEvent.StatTypes.CURRENT_STATISTICS); var dict = getValuesFromInput(data); foreach (var name in dict.Keys) { double value = 0; dict.TryGetValue(name, out value); stats.addResult(name, value); statE.values[(int)name] = value; } newStats.Invoke(statE); }