code: func (msg *MsgGetBlocks) BtcDecode(r io.Reader, pver uint32, enc MessageEncoding) error {
  	err := readElement(r, &msg.ProtocolVersion)
  	if err != nil {
  		return err
  	}
  
  	// Read num block locator hashes and limit to max.
  	count, err := ReadVarInt(r, pver)
  	if err != nil {
  		return err
  	}
  	if count > MaxBlockLocatorsPerMsg {
  		str := fmt.Sprintf("too many block locator hashes for message "+
  			"[count %v, max %v]", count, MaxBlockLocatorsPerMsg)
  		return messageError("MsgGetBlocks.BtcDecode", str)
  	}
  
  	// Create a contiguous slice of hashes to deserialize into in order to
  	// reduce the number of allocations.
  	locatorHashes := make([]chainhash.Hash, count)
  	msg.BlockLocatorHashes = make([]*chainhash.Hash, 0, count)
  	for i := uint64(0); i < count; i++ {
  		hash := &locatorHashes[i]
  		err := readElement(r, hash)
  		if err != nil {
  			return err
  		}
  		msg.AddBlockLocatorHash(hash)
  	}
  
  	return readElement(r, &msg.HashStop)
  }
docs: // BtcDecode decodes r using the bitcoin protocol encoding into the receiver.
  // This is part of the Message interface implementation.