From a583f7f6ca8c62aa3720e5b46a7463d94962d4b8 Mon Sep 17 00:00:00 2001 From: ledgerwatch Date: Fri, 19 Mar 2021 17:36:38 +0000 Subject: [PATCH] Try to fix multiple head subscriptions (#1565) Co-authored-by: Alexey Sharp --- ethdb/remote/remotedbserver/events.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ethdb/remote/remotedbserver/events.go b/ethdb/remote/remotedbserver/events.go index d2e8cf98a..ec25f7962 100644 --- a/ethdb/remote/remotedbserver/events.go +++ b/ethdb/remote/remotedbserver/events.go @@ -30,7 +30,7 @@ func (e *Events) OnNewHeader(newHeader *types.Header) { // remove subscription if i == len(e.headerSubscriptions)-1 { e.headerSubscriptions = e.headerSubscriptions[:i] - } else { + } else if i < len(e.headerSubscriptions)-1 { e.headerSubscriptions = append(e.headerSubscriptions[:i], e.headerSubscriptions[i+1:]...) } }