[#393] signature: Do not allocate a signature explicitly

Helpers from `util/signature` already allocates it for us.

Signed-off-by: Evgenii Stratonikov <evgeniy@nspcc.ru>
This commit is contained in:
Evgenii Stratonikov 2022-04-11 14:40:00 +03:00 committed by LeL
parent 77a3ba9197
commit 3d3283411c

View file

@ -194,14 +194,14 @@ func SignServiceMessage(key *ecdsa.PrivateKey, msg interface{}) error {
}
func signServiceMessagePart(key *ecdsa.PrivateKey, part stableMarshaler, sigWrite func(*refs.Signature)) error {
sig := new(refs.Signature)
var sig *refs.Signature
// sign part
if err := signature.SignDataWithHandler(
key,
&StableMarshalerWrapper{part},
func(s *refs.Signature) {
*sig = *s
sig = s
},
); err != nil {
return err