hyperledger/fabric

fabric/gossip/gossip /certstore.go第53行代码有点问题?

11090815 opened this issue · 2 comments

Description

第53行代码处,不应该是pull.RequestMsgType,而应该是pull.ResponseMsgType吧。

Steps to reproduce

line 53 puller.RegisterMsgHook(pull.RequestMsgType, func(_ []string, msgs []*protoext.SignedGossipMessage, _ protoext.ReceivedMessage) {

==>>

line 53 puller.RegisterMsgHook(pull.ResponseMsgType, func(_ []string, msgs []*protoext.SignedGossipMessage, _ protoext.ReceivedMessage) {

我也认为certstore.go第53行代码处要改为pull.ResponseMsgType.因为pullstore.go中(见179-209行)只有pullMsg=ResponseMsgType时,[]*protoext.SignedGossipMessag才会赋值,才会不为空,certstore.go行中RegisterMsgHook注册的函数的入参msgs []*protoext.SignedGossipMessag才会遍历执行。

I also believe that the code on line 53 in certstore.go should be changed to pull.ResponseMsgType. This is because in pullstore.go (see lines 179-209), the []*protoext.SignedGossipMessage array is only populated when pullMsg equals ResponseMsgType. This ensures that the array is not empty, allowing the function registered via RegisterMsgHook in certstore.go to iterate over the msgs []*protoext.SignedGossipMessage parameter and execute.