more elegant check for hasPeer - thanks to Thynix