mirror of
https://gitlab.com/pulsechaincom/erigon-pulse.git
synced 2024-12-22 11:41:19 +00:00
Try to fix multiple head subscriptions (#1565)
Co-authored-by: Alexey Sharp <alexeysharp@Alexeys-iMac.local>
This commit is contained in:
parent
bca9650834
commit
a583f7f6ca
@ -30,7 +30,7 @@ func (e *Events) OnNewHeader(newHeader *types.Header) {
|
|||||||
// remove subscription
|
// remove subscription
|
||||||
if i == len(e.headerSubscriptions)-1 {
|
if i == len(e.headerSubscriptions)-1 {
|
||||||
e.headerSubscriptions = e.headerSubscriptions[:i]
|
e.headerSubscriptions = e.headerSubscriptions[:i]
|
||||||
} else {
|
} else if i < len(e.headerSubscriptions)-1 {
|
||||||
e.headerSubscriptions = append(e.headerSubscriptions[:i], e.headerSubscriptions[i+1:]...)
|
e.headerSubscriptions = append(e.headerSubscriptions[:i], e.headerSubscriptions[i+1:]...)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user