From 729ba7e02a55dc81d6add00e3550ab1c40085145 Mon Sep 17 00:00:00 2001 From: ycc Date: Fri, 29 Mar 2024 15:59:33 +0100 Subject: [PATCH] add server pub key to background process --- client/helpers/backgroundHelper.go | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/client/helpers/backgroundHelper.go b/client/helpers/backgroundHelper.go index 2512737..935a8c4 100644 --- a/client/helpers/backgroundHelper.go +++ b/client/helpers/backgroundHelper.go @@ -53,8 +53,15 @@ func CheckForMessages(storage_path string, job *client.RequestsJob) (int, string //cr.LookupSignature = crl = append(crl, &cr) } + // get server public key + if job.Server.PublicKey == "" { + key, err := meowlib.HttpGetId(job.Server.Url) + if err != nil { + return -1, "CheckMessages: HttpGetId", err + } + job.Server.PublicKey = key["publicKey"] + } // build server message - var toSrv meowlib.ToServerMessage toSrv.PullRequest = crl toSrv.From = job.Server.UserKp.Public