Disable historical prices on testnets
This commit is contained in:
		
							parent
							
								
									bcfc704f7a
								
							
						
					
					
						commit
						2ceafcacc6
					
				| @ -41,6 +41,10 @@ class MiningRoutes { | ||||
|       res.header('Pragma', 'public'); | ||||
|       res.header('Cache-control', 'public'); | ||||
|       res.setHeader('Expires', new Date(Date.now() + 1000 * 300).toUTCString()); | ||||
|       if (['testnet', 'signet', 'liquidtestnet'].includes(config.MEMPOOL.NETWORK)) { | ||||
|         res.status(400).send('Prices are not available on testnets.'); | ||||
|         return; | ||||
|       } | ||||
|       if (req.query.timestamp) { | ||||
|         res.status(200).send(await PricesRepository.$getNearestHistoricalPrice( | ||||
|           parseInt(<string>req.query.timestamp ?? 0, 10) | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user