fix: prevent nil dereference in `IsControlNode` for existing communities

This commit is contained in:
Patryk Osmaczko 2023-10-19 19:04:27 +02:00 committed by osmaczko
parent 05db628406
commit fc8ce915af
1 changed files with 1 additions and 1 deletions

View File

@ -1086,7 +1086,7 @@ func (o *Community) ValidateEditSharedAddresses(signer *ecdsa.PublicKey, request
// We treat control node as an owner with community key // We treat control node as an owner with community key
func (o *Community) IsControlNode() bool { func (o *Community) IsControlNode() bool {
return o.config.PrivateKey != nil && o.config.PrivateKey.PublicKey.Equal(o.config.ControlNode) return o.config.PrivateKey != nil && o.config.PrivateKey.PublicKey.Equal(o.ControlNode())
} }
func (o *Community) IsOwnerWithoutCommunityKey() bool { func (o *Community) IsOwnerWithoutCommunityKey() bool {