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

pull/22036/head
Marius van der Wijden 4 years ago committed by GitHub
parent c7f2536735
commit 3c46f5570b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      cmd/faucet/faucet.go

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

Loading…
Cancel
Save