Configurable blacklist for tokens

This commit is contained in:
Teemu Patja 2017-11-08 17:49:36 +02:00
parent c630fcdb6d
commit 70e2afbd30
No known key found for this signature in database
GPG Key ID: F5B7035E6580FD4C
2 changed files with 13 additions and 2 deletions

View File

@ -41,4 +41,7 @@
:hubspot-contact-create-enabled false
;; needeed when :hubspot-contact-create-enabled
:hubspot-api-key "xxxxxxx-xxxx-x-xxxx-xxxx"}
:hubspot-api-key "xxxxxxx-xxxx-x-xxxx-xxxx"
;; used for blacklisting tokens from token registry data
:token-blacklist #{}}

View File

@ -6,13 +6,21 @@
(def token-data-atom (atom {}))
(defn token-blacklisted?
[tla]
(let [blacklist (env :token-blacklist #{})]
(blacklist tla)))
(defn update-data []
(let [test-data (env :testnet-token-data)
token-data
(if (and (env :on-testnet true)
test-data)
test-data
(token-reg/load-parity-tokenreg-data))]
(into {}
(filter (fn [[tla _]] (not (token-blacklisted? tla)))
(token-reg/load-parity-tokenreg-data))))]
(reset! token-data-atom token-data)))
(mount/defstate