From b931a75bd82bd9d6a148195a52c1917f58073d8e Mon Sep 17 00:00:00 2001 From: Mykhailo Prakhov Date: Fri, 22 Mar 2024 15:25:37 +0100 Subject: [PATCH] fix: crash on control node side dutring handling edited shared address from the member who left the community (#4967) --- protocol/communities/community.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/protocol/communities/community.go b/protocol/communities/community.go index e1da2a9a3..1973bf456 100644 --- a/protocol/communities/community.go +++ b/protocol/communities/community.go @@ -1176,7 +1176,12 @@ func (o *Community) ValidateEditSharedAddresses(signer *ecdsa.PublicKey, request return errors.New("no addresses were shared") } - if request.Clock < o.config.CommunityDescription.Members[common.PubkeyToHex(signer)].LastUpdateClock { + member, exists := o.config.CommunityDescription.Members[common.PubkeyToHex(signer)] + if !exists { + return errors.New("signer is not a community member") + } + + if request.Clock < member.LastUpdateClock { return errors.New("edit request is older than the last one we have. Ignore") }