Defense mechanism

I have no idea what kind of tree this is, only that I’m going to go ahead and trust that it is not in a good mood. One of my resolutions this year is to take the camera with me every time I take the dogs on a walk and find at least one interesting thing, and I thought this porcupine-like tree would start things off properly.