Give root chunks to nemunaire
continuous-integration/drone/push Build is passing Details

This commit is contained in:
nemunaire 2021-11-19 12:07:16 +01:00
parent 860f3eccaa
commit 69b9fc1d1f
1 changed files with 6 additions and 1 deletions

View File

@ -76,7 +76,12 @@ func ServeChunk(w http.ResponseWriter, r *http.Request) {
w.Write([]byte(err.Error()))
} else if checkChunk(uc.Proof) {
newChunk()
log.Println("Good chunk from", uc.Login)
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)
}
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.Write([]byte(err.Error()))