Unverified Commit 3e1a17ea authored by Artem Barger's avatar Artem Barger
Browse files

[FAB-5499]: Flatten logic of gossip Peers API

Current implmenetaition makes use of discovery GetMembership API and
iterates over to construct the result, while this is redundant, since we
can return GetMembership result right away. This commit replace
iteration with simply returning result of discovery service.

Change-Id: Idd69acd08560e0fac84bae43cd8acd50e6d8bdd0
Signed-off-by: default avatarArtem Barger <bartem@il.ibm.com>
parent f3d0f5c9
......@@ -646,12 +646,7 @@ func (g *gossipServiceImpl) Send(msg *proto.GossipMessage, peers ...*comm.Remote
// GetPeers returns a mapping of endpoint --> []discovery.NetworkMember
func (g *gossipServiceImpl) Peers() []discovery.NetworkMember {
s := []discovery.NetworkMember{}
for _, member := range g.disc.GetMembership() {
s = append(s, member)
return s
return g.disc.GetMembership()
// PeersOfChannel returns the NetworkMembers considered alive
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment