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:]...) } }