Use :multiaccount instead of :multiaccounts/multiaccounts when looking

through candidate public keys

Signed-off-by: Vitaliy Vlasov <siphiuel@gmail.com>
This commit is contained in:
Vitaliy Vlasov 2019-08-30 12:05:29 +03:00
parent 58ed03f976
commit aa4bf1f26b
No known key found for this signature in database
GPG Key ID: A7D57C347F2B2964
1 changed files with 3 additions and 2 deletions

View File

@ -91,12 +91,13 @@
(defn lookup-contact-pubkey-from-hash
[{:keys [db] :as cofx} contact-pubkey-or-hash]
"Tries to deanonymize a given contact pubkey hash by looking up the
full pubkey (if db is unlocked) in :contacts/contacts.
full pubkey (if db is unlocked) in :multiaccount and, if not found,
in :contacts/contacts.
Returns original value if not a hash (e.g. already a public key)."
(if (and contact-pubkey-or-hash
(= (count contact-pubkey-or-hash) pn-pubkey-hash-length))
(if-let [multiaccount-pubkey (hash->pubkey contact-pubkey-or-hash
(-> db :multiaccounts/multiaccounts vals))]
[(:multiaccount db)])]
multiaccount-pubkey
(if (multiaccounts.model/logged-in? cofx)
;; TODO: for simplicity we're doing a linear lookup of the contacts,