diff --git a/CHANGELOG_PENDING.md b/CHANGELOG_PENDING.md index 7af9acb3f8..8b2bb11970 100644 --- a/CHANGELOG_PENDING.md +++ b/CHANGELOG_PENDING.md @@ -19,10 +19,11 @@ #### CLI #### General +- [#2550](https://github.com/livepeer/go-livepeer/pull/2550) Fix requesting LPT from faucet after the Nitro migration (@leszko) #### Broadcaster -- [#2541](https://github.com/livepeer/go-livepeer/pull/2541) Enforce a minimum +- [#2541](https://github.com/livepeer/go-livepeer/pull/2541) Enforce a minimum timeout for segment upload (@victorges) #### Orchestrator diff --git a/server/handlers.go b/server/handlers.go index 7e8f05c8af..ad38ebe2b8 100644 --- a/server/handlers.go +++ b/server/handlers.go @@ -1029,13 +1029,13 @@ func requestTokensHandler(client eth.LivepeerEthClient) http.Handler { } backend := client.Backend() - blk, err := backend.BlockByNumber(r.Context(), nil) + h, err := backend.HeaderByNumber(r.Context(), nil) if err != nil { respond500(w, fmt.Sprintf("Unable to get latest block: %v", err)) return } - now := int64(blk.Time()) + now := int64(h.Time) if nextValidRequest.Int64() != 0 && nextValidRequest.Int64() > now { respond500(w, fmt.Sprintf("Error requesting tokens from faucet: can only request tokens once every hour, please wait %v more minutes", (nextValidRequest.Int64()-now)/60)) return