The Book of Marriage (Kitab Al-Nikah)
Muslim :: Book 8 : Hadith 3245
This hadith has been narrated on the authority of Isma'il with the same chain of transmitters (and the words are):" We were young, so we said: Allah's Messenger, should we not have ourselves castrated? But he (the narrator) did not say; We were on an expedition."