cmd/faucet: sort requests by newest first (#22018)

This commit is contained in:
Marius van der Wijden 2020-12-17 01:20:20 +01:00 committed by GitHub
parent c7f2536735
commit 3c46f5570b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -516,12 +516,12 @@ func (f *faucet) apiHandler(w http.ResponseWriter, r *http.Request) {
}
continue
}
f.reqs = append(f.reqs, &request{
f.reqs = append([]*request{{
Avatar: avatar,
Account: address,
Time: time.Now(),
Tx: signed,
})
}}, f.reqs...)
timeout := time.Duration(*minutesFlag*int(math.Pow(3, float64(msg.Tier)))) * time.Minute
grace := timeout / 288 // 24h timeout => 5m grace