code: func (sp *serverPeer) OnInv(_ *peer.Peer, msg *wire.MsgInv) {
  	if !cfg.BlocksOnly {
  		if len(msg.InvList) > 0 {
  			sp.server.syncManager.QueueInv(msg, sp.Peer)
  		}
  		return
  	}
  
  	newInv := wire.NewMsgInvSizeHint(uint(len(msg.InvList)))
  	for _, invVect := range msg.InvList {
  		if invVect.Type == wire.InvTypeTx {
  			peerLog.Tracef("Ignoring tx %v in inv from %v -- "+
  				"blocksonly enabled", invVect.Hash, sp)
  			if sp.ProtocolVersion() >= wire.BIP0037Version {
  				peerLog.Infof("Peer %v is announcing "+
  					"transactions -- disconnecting", sp)
  				sp.Disconnect()
  				return
  			}
  			continue
  		}
  		err := newInv.AddInvVect(invVect)
  		if err != nil {
  			peerLog.Errorf("Failed to add inventory vector: %v", err)
  			break
  		}
  	}
  
  	if len(newInv.InvList) > 0 {
  		sp.server.syncManager.QueueInv(newInv, sp.Peer)
  	}
  }
docs: // OnInv is invoked when a peer receives an inv bitcoin message and is
  // used to examine the inventory being advertised by the remote peer and react
  // accordingly.  We pass the message down to blockmanager which will call
  // QueueMessage with any appropriate responses.