Skip to content

Commit 48b484c

Browse files
authored
Merge pull request #21428 from holiman/ethstats_moar
ethstats: overwrite old errors
2 parents 06125bf + 6a53ce2 commit 48b484c

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

ethstats/ethstats.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -256,11 +256,11 @@ func (s *Service) loop() {
256256
header.Set("origin", "http://localhost")
257257
for _, url := range urls {
258258
c, _, e := dialer.Dial(url, header)
259-
if e == nil {
259+
err = e
260+
if err == nil {
260261
conn = newConnectionWrapper(c)
261262
break
262263
}
263-
err = e
264264
}
265265
if err != nil {
266266
log.Warn("Stats server unreachable", "err", err)
@@ -275,7 +275,6 @@ func (s *Service) loop() {
275275
continue
276276
}
277277
go s.readLoop(conn)
278-
279278
// Send the initial stats so our node looks decent from the get go
280279
if err = s.report(conn); err != nil {
281280
log.Warn("Initial stats report failed", "err", err)

0 commit comments

Comments
 (0)