more reliable address comparison

Signed-off-by: Michele Balistreri <michele@bitgamma.com>
This commit is contained in:
Michele Balistreri 2022-07-05 13:29:56 +02:00
parent b136602322
commit ca3db6b889
No known key found for this signature in database
GPG Key ID: E9567DA33A4F791A
2 changed files with 3 additions and 3 deletions

View File

@ -153,8 +153,8 @@
(defn address= [address1 address2]
(and address1 address2
(= (normalized-hex address1)
(normalized-hex address2))))
(= (string/lower-case (normalized-hex address1))
(string/lower-case (normalized-hex address2)))))
(defn public-key->address [public-key]
(let [length (count public-key)

View File

@ -24,7 +24,7 @@
from (or (get-in db [:signing/tx :from :address]) (get-in db [:signing/tx :message :from]) (ethereum/default-address db))
path (reduce
(fn [_ {:keys [address path]}]
(when (= from address)
(when (ethereum/address= from address)
(reduced path)))
nil
(:multiaccount/accounts db))]