I'm glad you shared this with us and not with your wife. She doesn't need to know this information, at least not while there's the slightest chance she might take it personally. Times of stress definitely lend themselves to that.
If you haven't read Lance Dodes' "The Heart of Addiction," I'd highly recommend that you check it out. What you described is 100% in alignment with his perspective on addiction.
Well done!
O