From 7144bc53a04dd4a4d4386ebc11de65b11f537783 Mon Sep 17 00:00:00 2001 From: Hitenjain14 Date: Sat, 23 Nov 2024 10:56:21 +0530 Subject: [PATCH 1/3] only update key if split key is enabled --- zboxcore/sdk/allocation.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zboxcore/sdk/allocation.go b/zboxcore/sdk/allocation.go index d419c8130..f261609f5 100644 --- a/zboxcore/sdk/allocation.go +++ b/zboxcore/sdk/allocation.go @@ -456,7 +456,7 @@ func (a *Allocation) generateAndSetOwnerSigningPublicKey() { l.Logger.Error("Failed to generate owner signing key", zap.Error(err)) return } - if a.OwnerSigningPublicKey == "" && !a.Finalized && !a.Canceled { + if a.OwnerSigningPublicKey == "" && !a.Finalized && !a.Canceled && client.Wallet().IsSplit { pubKey := privateSigningKey.Public().(ed25519.PublicKey) a.OwnerSigningPublicKey = hex.EncodeToString(pubKey) hash, _, err := UpdateAllocation(0, false, a.ID, 0, "", "", "", a.OwnerSigningPublicKey, false, nil) From 646bbe15dceb479d131cc439738512d3b2a8bffd Mon Sep 17 00:00:00 2001 From: Hitenjain14 Date: Sat, 23 Nov 2024 22:31:18 +0530 Subject: [PATCH 2/3] add check for empty key --- zboxcore/sdk/allocation.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zboxcore/sdk/allocation.go b/zboxcore/sdk/allocation.go index f261609f5..97c892d98 100644 --- a/zboxcore/sdk/allocation.go +++ b/zboxcore/sdk/allocation.go @@ -466,7 +466,7 @@ func (a *Allocation) generateAndSetOwnerSigningPublicKey() { } l.Logger.Info("Owner signing public key updated with transaction : ", hash, " ownerSigningPublicKey : ", a.OwnerSigningPublicKey) a.Tx = hash - } else { + } else if a.OwnerSigningPublicKey != "" { pubKey := privateSigningKey.Public().(ed25519.PublicKey) l.Logger.Info("Owner signing public key already exists: ", a.OwnerSigningPublicKey, " generated: ", hex.EncodeToString(pubKey)) } From f0b5422dc37186248b08a4adc11e2602436b053a Mon Sep 17 00:00:00 2001 From: Hitenjain14 Date: Sat, 23 Nov 2024 23:17:19 +0530 Subject: [PATCH 3/3] return if key is empty --- zboxcore/sdk/allocation.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/zboxcore/sdk/allocation.go b/zboxcore/sdk/allocation.go index 97c892d98..5528ed7b8 100644 --- a/zboxcore/sdk/allocation.go +++ b/zboxcore/sdk/allocation.go @@ -469,6 +469,8 @@ func (a *Allocation) generateAndSetOwnerSigningPublicKey() { } else if a.OwnerSigningPublicKey != "" { pubKey := privateSigningKey.Public().(ed25519.PublicKey) l.Logger.Info("Owner signing public key already exists: ", a.OwnerSigningPublicKey, " generated: ", hex.EncodeToString(pubKey)) + } else { + return } a.privateSigningKey = privateSigningKey }