Filter out non-RPC networks for new and restored accounts.

Those who plainly upgrades, will keep these networks as "Custom" in their DB.

Signed-off-by: Julien Eluard <julien.eluard@gmail.com>
This commit is contained in:
Igor Mandrigin 2018-05-23 12:04:50 +02:00 committed by Julien Eluard
parent f16bd200e8
commit 732de57444
No known key found for this signature in database
GPG Key ID: 6FD7DB5437FCBEF6
4 changed files with 11 additions and 2 deletions

1
.env
View File

@ -3,6 +3,7 @@ STUB_STATUS_GO=0
ETHEREUM_DEV_CLUSTER=1 ETHEREUM_DEV_CLUSTER=1
MAINNET_WARNING_ENABLED=0 MAINNET_WARNING_ENABLED=0
OFFLINE_INBOX_ENABLED=1 OFFLINE_INBOX_ENABLED=1
RPC_NETWORKS_ONLY 1
LOG_LEVEL=debug LOG_LEVEL=debug
LOG_LEVEL_STATUS_GO=info LOG_LEVEL_STATUS_GO=info
QUEUE_MESSAGE_ENABLED=1 QUEUE_MESSAGE_ENABLED=1

View File

@ -2,6 +2,7 @@ TESTFAIRY_ENABLED=0
STUB_STATUS_GO=0 STUB_STATUS_GO=0
ETHEREUM_DEV_CLUSTER=0 ETHEREUM_DEV_CLUSTER=0
MAINNET_WARNING_ENABLED=1 MAINNET_WARNING_ENABLED=1
RPC_NETWORKS_ONLY 1
OFFLINE_INBOX_ENABLED=0 OFFLINE_INBOX_ENABLED=0
LOG_LEVEL=info LOG_LEVEL=info
LOG_LEVEL_STATUS_GO=info LOG_LEVEL_STATUS_GO=info

View File

@ -68,9 +68,14 @@
:UpstreamConfig {:Enabled true :UpstreamConfig {:Enabled true
:URL "https://rinkeby.infura.io/z6GCTmjdP3FETEJmMBI4"}}}}) :URL "https://rinkeby.infura.io/z6GCTmjdP3FETEJmMBI4"}}}})
(defn network-enabled? [network]
(if config/rpc-networks-only?
(get-in (val network) [:config :UpstreamConfig :Enabled])
true))
(def default-networks (def default-networks
(merge testnet-networks (into {} (filter network-enabled?
mainnet-networks)) (merge testnet-networks mainnet-networks))))
(def default-wnodes (def default-wnodes
{:testnet {"mailserver-a" {:id "mailserver-a" {:testnet {"mailserver-a" {:id "mailserver-a"

View File

@ -32,6 +32,8 @@
(def compile-views-enabled? (enabled? (get-config :COMPILE_VIEWS_ENABLED 0))) (def compile-views-enabled? (enabled? (get-config :COMPILE_VIEWS_ENABLED 0)))
(def mixpanel-token (get-config :MIXPANEL_TOKEN)) (def mixpanel-token (get-config :MIXPANEL_TOKEN))
(def default-network (get-config :DEFAULT_NETWORK)) (def default-network (get-config :DEFAULT_NETWORK))
;; the default value should be a string for `enabled?` to work correctly.
(def rpc-networks-only? (enabled? (get-config :RPC_NETWORKS_ONLY "1")))
(def testfairy-token (get-config :TESTFAIRY_TOKEN)) (def testfairy-token (get-config :TESTFAIRY_TOKEN))
(def instabug-token (get-config :INSTABUG_TOKEN)) (def instabug-token (get-config :INSTABUG_TOKEN))
(def instabug-surveys-enabled? (get-config :INSTABUG_SURVEYS)) (def instabug-surveys-enabled? (get-config :INSTABUG_SURVEYS))