mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-20 10:52:25 +00:00
eth/filter/api : add missing timer.Stop() calls as object attribute
This commit is contained in:
parent
f7b29ec942
commit
b587bffafa
1 changed files with 3 additions and 1 deletions
|
|
@ -111,6 +111,7 @@ func (api *PublicFilterAPI) NewPendingTransactionFilter() rpc.ID {
|
|||
api.filtersMu.Lock()
|
||||
api.filters[pendingTxSub.ID] = &filter{typ: PendingTransactionsSubscription, deadline: time.NewTimer(deadline), hashes: make([]common.Hash, 0), s: pendingTxSub}
|
||||
api.filtersMu.Unlock()
|
||||
defer api.filters[pendingTxSub.ID].deadline.Stop()
|
||||
|
||||
go func() {
|
||||
for {
|
||||
|
|
@ -181,7 +182,7 @@ func (api *PublicFilterAPI) NewBlockFilter() rpc.ID {
|
|||
api.filtersMu.Lock()
|
||||
api.filters[headerSub.ID] = &filter{typ: BlocksSubscription, deadline: time.NewTimer(deadline), hashes: make([]common.Hash, 0), s: headerSub}
|
||||
api.filtersMu.Unlock()
|
||||
|
||||
defer api.filters[headerSub.ID].deadline.Stop()
|
||||
go func() {
|
||||
for {
|
||||
select {
|
||||
|
|
@ -298,6 +299,7 @@ func (api *PublicFilterAPI) NewFilter(crit FilterCriteria) (rpc.ID, error) {
|
|||
api.filtersMu.Lock()
|
||||
api.filters[logsSub.ID] = &filter{typ: LogsSubscription, crit: crit, deadline: time.NewTimer(deadline), logs: make([]*types.Log, 0), s: logsSub}
|
||||
api.filtersMu.Unlock()
|
||||
defer api.filters[logsSub.ID].deadline.Stop()
|
||||
|
||||
go func() {
|
||||
for {
|
||||
|
|
|
|||
Loading…
Reference in a new issue