From bfcbcd07a463c8eb782540e81d34226ffd8bca3a Mon Sep 17 00:00:00 2001
From: Nadav Ivgi <nadav@shesek.info>
Date: Tue, 5 Feb 2019 14:41:55 +0200
Subject: [PATCH] Add --no-rates to disable fetching of currency exchange rates

---
 app/utils.js | 2 ++
 bin/cli.js   | 1 +
 2 files changed, 3 insertions(+)

diff --git a/app/utils.js b/app/utils.js
index 9b8130f..68924fb 100644
--- a/app/utils.js
+++ b/app/utils.js
@@ -276,6 +276,8 @@ function getBlockTotalFeesFromCoinbaseTxAndBlockHeight(coinbaseTx, blockHeight)
 }
 
 function refreshExchangeRates() {
+	if (process.env.BTCEXP_NO_RATES) return;
+
 	if (coins[config.coin].exchangeRateData) {
 		request(coins[config.coin].exchangeRateData.jsonUrl, function(error, response, body) {
 			if (!error && response && response.statusCode && response.statusCode == 200) {
diff --git a/bin/cli.js b/bin/cli.js
index 83a5654..4522be3 100755
--- a/bin/cli.js
+++ b/bin/cli.js
@@ -18,6 +18,7 @@ const args = require('meow')(`
 
       --cookie-secret <secret>     secret key for signed cookie hmac generation [default: hmac derive from bitcoind pass]
       --demo                       enable demoSite mode [default: disabled]
+      --no-rates                   disable fetching of currency exchange rates [default: enabled]
 
       --ipstack-key <key>          api access key for ipstack (for geoip) [default: disabled]
       --ganalytics-tracking <tid>  tracking id for google analytics [default: disabled]