Merge pull request #5595 from mempool/nymkappa/hashrate-1w
[mining] use getNetworkHashPs(1008)
This commit is contained in:
		
						commit
						8a579cc374
					
				| @ -183,7 +183,7 @@ class MiningRoutes { | |||||||
|   private async $getHistoricalHashrate(req: Request, res: Response) { |   private async $getHistoricalHashrate(req: Request, res: Response) { | ||||||
|     let currentHashrate = 0, currentDifficulty = 0; |     let currentHashrate = 0, currentDifficulty = 0; | ||||||
|     try { |     try { | ||||||
|       currentHashrate = await bitcoinClient.getNetworkHashPs(); |       currentHashrate = await bitcoinClient.getNetworkHashPs(1008); | ||||||
|       currentDifficulty = await bitcoinClient.getDifficulty(); |       currentDifficulty = await bitcoinClient.getDifficulty(); | ||||||
|     } catch (e) { |     } catch (e) { | ||||||
|       logger.debug('Bitcoin Core is not available, using zeroed value for current hashrate and difficulty'); |       logger.debug('Bitcoin Core is not available, using zeroed value for current hashrate and difficulty'); | ||||||
|  | |||||||
| @ -5,7 +5,7 @@ | |||||||
|   <div *ngIf="widget"> |   <div *ngIf="widget"> | ||||||
|     <div class="pool-distribution" *ngIf="(hashrateObservable$ | async) as hashrates; else loadingStats"> |     <div class="pool-distribution" *ngIf="(hashrateObservable$ | async) as hashrates; else loadingStats"> | ||||||
|       <div class="item"> |       <div class="item"> | ||||||
|         <h5 class="card-title" i18n="mining.hashrate">Hashrate</h5> |         <h5 class="card-title" i18n="mining.hashrate">Hashrate (1w)</h5> | ||||||
|         <p class="card-text"> |         <p class="card-text"> | ||||||
|           {{ hashrates.currentHashrate | amountShortener: 1 : 'H/s' }} |           {{ hashrates.currentHashrate | amountShortener: 1 : 'H/s' }} | ||||||
|         </p> |         </p> | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user