Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions eth/filters/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ func (api *FilterAPI) timeoutLoop(timeout time.Duration) {
select {
case <-ticker.C:
case <-api.events.chainSub.Err():
api.events.chainSub.Unsubscribe()
return
}
api.filtersMu.Lock()
Expand Down Expand Up @@ -231,6 +232,7 @@ func (api *FilterAPI) NewBlockFilter() rpc.ID {
api.filtersMu.Lock()
delete(api.filters, headerSub.ID)
api.filtersMu.Unlock()
headerSub.Unsubscribe()
return
}
}
Expand Down Expand Up @@ -417,6 +419,7 @@ func (api *FilterAPI) NewFilter(crit FilterCriteria) (rpc.ID, error) {
api.filtersMu.Lock()
delete(api.filters, logsSub.ID)
api.filtersMu.Unlock()
logsSub.Unsubscribe()
return
}
}
Expand Down
1 change: 1 addition & 0 deletions eth/gasprice/gasprice.go
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ func NewOracle(backend OracleBackend, params Config, startPrice *big.Int) *Oracl
sub := backend.SubscribeChainHeadEvent(headEvent)
if sub != nil { // the gasprice testBackend doesn't support subscribing to head events
go func() {
defer sub.Unsubscribe()
var lastHead common.Hash
for {
select {
Expand Down