Give root chunks to nemunaire
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
860f3eccaa
commit
69b9fc1d1f
5
main.go
5
main.go
@ -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()))
|
||||||
|
Reference in New Issue
Block a user