Skip to content

Commit

Permalink
[FAB-14688] Check inner, not outer block msg
Browse files Browse the repository at this point in the history
The gossip code that handles pull block data updates
has an optimization that first performs a simulation
of adding an inner block message to the message store,
and only if the simulation is successful  -
it then verifies the message.

The problem is that the simulation is done against the outer
message, and thus the optimization does not occur.

This change set fixes this.

Change-Id: I71c94e9b1cad2bfa6e9cfce700d8bd3209e9b5e7
Signed-off-by: yacovm <yacovm@il.ibm.com>
  • Loading branch information
yacovm committed Mar 18, 2019
1 parent ceef61f commit 7192430
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions gossip/gossip/channel/channel.go
Expand Up @@ -592,8 +592,8 @@ func (gc *gossipChannel) HandleMessage(msg proto.ReceivedMessage) {
return
}
// Would this block go into the message store if it was verified?
if !gc.blockMsgStore.CheckValid(msg.GetGossipMessage()) {
return
if !gc.blockMsgStore.CheckValid(gMsg) {
continue
}
if !gc.verifyBlock(gMsg.GossipMessage, msg.GetConnectionInfo().ID) {
return
Expand Down

0 comments on commit 7192430

Please sign in to comment.