mirror of
https://github.com/unclebob/more-speech.git
synced 2024-09-30 10:30:56 +00:00
use the public-key in the keys file, rather than recomputing it. Some clients use a different algorithm for going from priv-key to pub-key and we want users to be able to set their pubkey to keep their public ids consistent.
This commit is contained in:
parent
64a823e214
commit
c73cae8293
@ -259,7 +259,7 @@
|
||||
[event-state body]
|
||||
(let [keys (:keys event-state)
|
||||
private-key (util/hex-string->bytes (:private-key keys))
|
||||
pubkey (ecc/get-pub-key private-key)
|
||||
pubkey (util/hex-string->bytes (:public-key keys))
|
||||
now (quot (System/currentTimeMillis) 1000)
|
||||
body (assoc body :pubkey (util/bytes->hex-string pubkey)
|
||||
:created_at now)
|
||||
@ -294,9 +294,7 @@
|
||||
(compose-text-event event-state subject text nil))
|
||||
|
||||
([event-state subject text reply-to-or-nil]
|
||||
(let [private-key (get-in event-state [:keys :private-key])
|
||||
private-key (util/hex-string->bytes private-key)
|
||||
pubkey (ecc/get-pub-key private-key)
|
||||
(let [pubkey (util/hex-string->bytes (get-in event-state [:keys :public-key]))
|
||||
root (get-reply-root event-state reply-to-or-nil)
|
||||
tags (concat (make-event-reference-tags reply-to-or-nil root)
|
||||
(make-people-reference-tags event-state pubkey reply-to-or-nil)
|
||||
|
Loading…
Reference in New Issue
Block a user