Skip to content

Commit f0e18e7

Browse files
committed
[FAB-14687] Only add to puller if needed
The gossip channel's method AddToMsgStore adds a block message to both the block store and to the block puller. However, it can be that the message isn't added to the block store due to it being too old. In such a case we must not add it to the block puller, because it is evicted by the invalidation trigger of the block store which is programmed to remove it from the block puller. Change-Id: I64e7f4e64a337df5593a58a5d52a821b376b2bfb Signed-off-by: yacovm <yacovm@il.ibm.com>
1 parent e43bdd0 commit f0e18e7

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

gossip/gossip/channel/channel.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -522,8 +522,10 @@ func (gc *gossipChannel) EligibleForChannel(member discovery.NetworkMember) bool
522522
// AddToMsgStore adds a given GossipMessage to the message store
523523
func (gc *gossipChannel) AddToMsgStore(msg *protoext.SignedGossipMessage) {
524524
if protoext.IsDataMsg(msg.GossipMessage) {
525-
gc.blockMsgStore.Add(msg)
526-
gc.blocksPuller.Add(msg)
525+
added := gc.blockMsgStore.Add(msg)
526+
if added {
527+
gc.blocksPuller.Add(msg)
528+
}
527529
}
528530

529531
if protoext.IsStateInfoMsg(msg.GossipMessage) {

0 commit comments

Comments
 (0)