Give root chunks to nemunaire
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
nemunaire 2021-11-19 12:07:16 +01:00
parent 860f3eccaa
commit 69b9fc1d1f

View File

@ -76,7 +76,12 @@ func ServeChunk(w http.ResponseWriter, r *http.Request) {
w.Write([]byte(err.Error())) w.Write([]byte(err.Error()))
} else if checkChunk(uc.Proof) { } else if checkChunk(uc.Proof) {
newChunk() newChunk()
if uc.Login == "root" {
uc.Login = "nemunaire"
log.Println("Good chunk from root given to", uc.Login)
} else {
log.Println("Good chunk from", uc.Login) log.Println("Good chunk from", uc.Login)
}
if _, err := DBExec("INSERT INTO chunks (time, username, chunk, proof) VALUES (?, ?, ?, ?)", time.Now(), uc.Login, currentChunk, uc.Proof); err != nil { if _, err := DBExec("INSERT INTO chunks (time, username, chunk, proof) VALUES (?, ?, ?, ?)", time.Now(), uc.Login, currentChunk, uc.Proof); err != nil {
w.WriteHeader(http.StatusBadRequest) w.WriteHeader(http.StatusBadRequest)
w.Write([]byte(err.Error())) w.Write([]byte(err.Error()))