|
|
@@ -360,11 +360,14 @@ func (f *faucet) apiHandler(w http.ResponseWriter, r *http.Request) {
|
|
|
}
|
|
|
}
|
|
|
// Send over the initial stats and the latest header
|
|
|
+ f.lock.RLock()
|
|
|
+ reqs := f.reqs
|
|
|
+ f.lock.RUnlock()
|
|
|
if err = send(conn, map[string]interface{}{
|
|
|
"funds": new(big.Int).Div(balance, ether),
|
|
|
"funded": nonce,
|
|
|
"peers": f.stack.Server().PeerCount(),
|
|
|
- "requests": f.reqs,
|
|
|
+ "requests": reqs,
|
|
|
}, 3*time.Second); err != nil {
|
|
|
log.Warn("Failed to send initial stats to client", "err", err)
|
|
|
return
|