more idiomatic message copying for signature purposes

This commit is contained in:
vyzo 2018-09-05 20:48:44 +03:00
parent 3788f504a5
commit b353ddca06
1 changed files with 3 additions and 6 deletions

View File

@ -17,12 +17,9 @@ func verifyMessageSignature(m *pb.Message) error {
return err
}
xm := pb.Message{
Data: m.Data,
TopicIDs: m.TopicIDs,
From: m.From,
Seqno: m.Seqno,
}
xm := *m
xm.Signature = nil
xm.Key = nil
bytes, err := xm.Marshal()
if err != nil {
return err