iferr!=nil&&fmt.Sprintf("%v",err)!="550 Unspecified Tor error: Onion address collision"{
iferr==nil&&!dontCheckDescriptor{
pi,_:=c.ProtocolInfo()
// 0.3.5.1
torversion:=strings.Split(pi.TorVersion,".")
tva,_:=strconv.Atoi(torversion[0])
tvb,_:=strconv.Atoi(torversion[1])
tvc,_:=strconv.Atoi(torversion[2])
iftva==0&&(tvb<3||(tvb==3&&tvc<5)){
// here we need to check if the descriptor upload succeeded
log.Println("running a descriptor check because you are on tor version < 0.3.5.1-alpha. this will take a little while but only happens once per tor process--onion service pair")
log.Printf("uh oh: your tor process is using a service descriptor revision counter of %d\n",src)
log.Printf("whereas the HSDirs have revision %d. this is a bug in tor < 0.3.5.1-alpha\n",crc)
log.Printf("your have two options to fix it:\n")
log.Printf("- upgrade to tor >= 0.3.5.1-alpha [recommended]\n")
log.Printf("- run this listener %d more times [not a great idea but it'll work]\n",crc-src)
log.Printf("the revision counter is only reset when the tor process restarts, so try not to do that in order to prevent this problem from reoccurring\n")
returnnil,errors.New("client descriptor is newer than service descriptor")
}
fmt.Printf("crc: %v src: %v\n",crc,src)
}
}elseiffmt.Sprintf("%v",err)!="550 Unspecified Tor error: Onion address collision"{
// (don't worry if there is an address collision -- it's a good thing and means we're using the cached circuits)