Skip to content

Latest commit

 

History

History
22 lines (19 loc) · 1.03 KB

逆向工程.md

File metadata and controls

22 lines (19 loc) · 1.03 KB

Gossip 中,如果是 pull 类型的消息,那么此消息的发送者与消息的接收者必须在同一 org 内,不然接收者会直接忽略掉此 pull 消息。

if !gc.eligibleForChannelAndSameOrg(utils.NetworkMember{PKIid: msg.GetConnectionInfo().PkiID}) {
	gc.logger.Warnf("Peer %s is not eligible for pulling blocks from channel %s.", msg.GetConnectionInfo().PkiID.String(), gc.channelID.String())
	return
}

Gossip 的 Channel 中的消息,如果消息来自于不属于此 Channel 的 org,那么会忽略此消息。

orgId := gc.adapter.GetOrgOfPeer(msg.GetConnectionInfo().PkiID)
if len(orgId) == 0 {
	gc.logger.Warnf("The peer sent message %s belongs to an unknown organization, discarding it.", utils.GossipMessageToString(sgm.GossipMessage))
	return
}
if !gc.IsOrgInChannel(orgId) {
	gc.logger.Warnf("The peer sent message %s belongs to an organization (%s) which is not eligible for the channel %s, discarding it.", utils.GossipMessageToString(sgm.GossipMessage), orgId.String(), gc.channelID.String())
	return
}