From c1960d86b9fc427fc41c8e432a5109b8f1a780f4 Mon Sep 17 00:00:00 2001 From: Wondertan Date: Mon, 14 Feb 2022 12:17:20 +0200 Subject: [PATCH] chore(service/header): rename inner msgID func to a shorter one --- service/header/p2p_subscriber.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/service/header/p2p_subscriber.go b/service/header/p2p_subscriber.go index 926094808e..8ff1185193 100644 --- a/service/header/p2p_subscriber.go +++ b/service/header/p2p_subscriber.go @@ -84,7 +84,7 @@ func (p *P2PSubscriber) Broadcast(ctx context.Context, header *ExtendedHeader) e // msgID computes an id for a pubsub message // TODO(@Wondertan): This cause additional allocations per each recvd message in the topic. Find a way to avoid those. func msgID(pmsg *pb.Message) string { - msgID := func(data []byte) string { + mID := func(data []byte) string { hash := blake2b.Sum256(data) return string(hash[:]) } @@ -93,7 +93,7 @@ func msgID(pmsg *pb.Message) string { if err != nil { // There is nothing we can do about the error, and it will be anyway caught during validation. // We also *have* to return some ID for the msg, so give the hash of even faulty msg - return msgID(pmsg.Data) + return mID(pmsg.Data) } // IMPORTANT NOTE: @@ -110,8 +110,8 @@ func msgID(pmsg *pb.Message) string { data, err := MarshalExtendedHeader(h) if err != nil { // See the note under unmarshalling step - return msgID(pmsg.Data) + return mID(pmsg.Data) } - return msgID(data) + return mID(data) }