Fix possible crash in multisig-wallet/token-balances

* ignore tokens existing in bounty contract if they are not in our
  tokenreg, avoids crash silently leading to token balances not
  gettings saved
This commit is contained in:
Teemu Patja 2017-08-25 23:57:28 +03:00
parent bb5dc7b85a
commit 002946c1fd
No known key found for this signature in database
GPG Key ID: F5B7035E6580FD4C
1 changed files with 3 additions and 3 deletions

View File

@ -168,9 +168,9 @@
(let [addrs (map str (let [addrs (map str
(.getValue token-addresses))] (.getValue token-addresses))]
(into {} (into {}
(map (fn [addr] (let [tla (first (token-data/token-info-by-addr addr))] (map (fn [addr] (if-let [info (token-data/token-info-by-addr addr)]
(assert tla) (let [tla (first info)]
[tla (token-balance bounty-addr tla)])) addrs))) [tla (token-balance bounty-addr tla)]))) addrs)))
{}))) {})))
(defn transfer-tokens (defn transfer-tokens