File tree Expand file tree Collapse file tree 5 files changed +10
-11
lines changed
Expand file tree Collapse file tree 5 files changed +10
-11
lines changed Original file line number Diff line number Diff line change @@ -2,9 +2,9 @@ namespace Miningcore.Api.Responses;
22
33public partial class AggregatedPoolStats
44{
5- public float PoolHashrate { get ; set ; }
5+ public double PoolHashrate { get ; set ; }
66 public int ConnectedMiners { get ; set ; }
7- public int ValidSharesPerSecond { get ; set ; }
7+ public double ValidSharesPerSecond { get ; set ; }
88 public double NetworkHashrate { get ; set ; }
99 public double NetworkDifficulty { get ; set ; }
1010
Original file line number Diff line number Diff line change @@ -4,6 +4,6 @@ public class PoolStats
44{
55 public DateTime ? LastPoolBlockTime { get ; set ; }
66 public int ConnectedMiners { get ; set ; }
7- public ulong PoolHashrate { get ; set ; }
8- public int SharesPerSecond { get ; set ; }
7+ public double PoolHashrate { get ; set ; }
8+ public double SharesPerSecond { get ; set ; }
99}
Original file line number Diff line number Diff line change @@ -130,12 +130,11 @@ private async Task UpdatePoolHashratesAsync(CancellationToken ct)
130130 // pool hashrate
131131 var poolHashesAccumulated = result . Sum ( x => x . Sum ) ;
132132 var poolHashrate = pool . HashrateFromShares ( poolHashesAccumulated , poolHashTimeFrame ) ;
133- poolHashrate = Math . Floor ( poolHashrate ) ;
134- pool . PoolStats . PoolHashrate = ( ulong ) poolHashrate ;
133+ pool . PoolStats . PoolHashrate = poolHashrate ;
135134
136135 // pool shares
137136 var poolHashesCountAccumulated = result . Sum ( x => x . Count ) ;
138- pool . PoolStats . SharesPerSecond = ( int ) ( poolHashesCountAccumulated / poolHashTimeFrame ) ;
137+ pool . PoolStats . SharesPerSecond = Math . Round ( poolHashesCountAccumulated / poolHashTimeFrame , 3 ) ;
139138
140139 messageBus . NotifyHashrateUpdated ( pool . Config . Id , poolHashrate ) ;
141140 }
Original file line number Diff line number Diff line change @@ -6,13 +6,13 @@ public record PoolStats
66 public string PoolId { get ; init ; }
77
88 public int ConnectedMiners { get ; init ; }
9- public float PoolHashrate { get ; init ; }
9+ public double PoolHashrate { get ; init ; }
1010 public double NetworkHashrate { get ; init ; }
1111 public double NetworkDifficulty { get ; init ; }
1212 public DateTime ? LastNetworkBlockTime { get ; init ; }
1313 public long BlockHeight { get ; init ; }
1414 public int ConnectedPeers { get ; init ; }
15- public int SharesPerSecond { get ; init ; }
15+ public double SharesPerSecond { get ; init ; }
1616
1717 public DateTime Created { get ; init ; }
1818}
Original file line number Diff line number Diff line change @@ -6,13 +6,13 @@ public class PoolStats
66 public string PoolId { get ; set ; }
77
88 public int ConnectedMiners { get ; set ; }
9- public float PoolHashrate { get ; set ; }
9+ public double PoolHashrate { get ; set ; }
1010 public double NetworkHashrate { get ; set ; }
1111 public double NetworkDifficulty { get ; set ; }
1212 public DateTime ? LastNetworkBlockTime { get ; set ; }
1313 public long BlockHeight { get ; set ; }
1414 public int ConnectedPeers { get ; set ; }
15- public int SharesPerSecond { get ; set ; }
15+ public double SharesPerSecond { get ; set ; }
1616
1717 public DateTime Created { get ; set ; }
1818}
You can’t perform that action at this time.
0 commit comments