@@ -68,7 +68,6 @@ type Backend interface {
6868 ChainConfig () * params.ChainConfig
6969 HistoryPruningCutoff () uint64
7070 SubscribeNewTxsEvent (chan <- core.NewTxsEvent ) event.Subscription
71- SubscribeNewQueuedTxsEvent (chan <- core.NewQueuedTxsEvent ) event.Subscription
7271 SubscribeChainEvent (ch chan <- core.ChainEvent ) event.Subscription
7372 SubscribeRemovedLogsEvent (ch chan <- core.RemovedLogsEvent ) event.Subscription
7473 SubscribeLogsEvent (ch chan <- []* types.Log ) event.Subscription
@@ -157,9 +156,6 @@ const (
157156 // PendingTransactionsSubscription queries for pending transactions entering
158157 // the pending state
159158 PendingTransactionsSubscription
160- // QueuedTransactionsSubscription queries tx hashes for queued
161- // transactions entering the queued state
162- QueuedTransactionsSubscription
163159 // BlocksSubscription queries hashes for blocks that are imported
164160 BlocksSubscription
165161 // TransactionReceiptsSubscription queries for transaction receipts when transactions are included in blocks
@@ -172,9 +168,6 @@ const (
172168 // txChanSize is the size of channel listening to NewTxsEvent.
173169 // The number is referenced from the size of tx pool.
174170 txChanSize = 4096
175- // queuedTxChanSize is the size of channel listening to NewQueuedTxsEvent.
176- // The number is referenced from the size of tx pool.
177- queuedTxChanSize = 4096
178171 // rmLogsChanSize is the size of channel listening to RemovedLogsEvent.
179172 rmLogsChanSize = 10
180173 // logsChanSize is the size of channel listening to LogsEvent.
@@ -190,8 +183,6 @@ type subscription struct {
190183 logsCrit ethereum.FilterQuery
191184 logs chan []* types.Log
192185 txs chan []* types.Transaction
193- hashes chan []common.Hash
194- queuedTxs chan []* types.Transaction
195186 headers chan * types.Header
196187 receipts chan []* ReceiptWithTx
197188 txHashes map [common.Hash ]bool // contains transaction hashes for transactionReceipts subscription filtering
@@ -206,20 +197,18 @@ type EventSystem struct {
206197 sys * FilterSystem
207198
208199 // Subscriptions
209- txsSub event.Subscription // Subscription for new transaction event
210- queuedTxsSub event.Subscription // Subscription for new queued transaction event
211- logsSub event.Subscription // Subscription for new log event
212- rmLogsSub event.Subscription // Subscription for removed log event
213- chainSub event.Subscription // Subscription for new chain event
200+ txsSub event.Subscription // Subscription for new transaction event
201+ logsSub event.Subscription // Subscription for new log event
202+ rmLogsSub event.Subscription // Subscription for removed log event
203+ chainSub event.Subscription // Subscription for new chain event
214204
215205 // Channels
216- install chan * subscription // install filter for event notification
217- uninstall chan * subscription // remove filter for event notification
218- txsCh chan core.NewTxsEvent // Channel to receive new transactions event
219- queuedTxsCh chan core.NewQueuedTxsEvent // Channel to receive new queued transactions event
220- logsCh chan []* types.Log // Channel to receive new log event
221- rmLogsCh chan core.RemovedLogsEvent // Channel to receive removed log event
222- chainCh chan core.ChainEvent // Channel to receive new chain event
206+ install chan * subscription // install filter for event notification
207+ uninstall chan * subscription // remove filter for event notification
208+ txsCh chan core.NewTxsEvent // Channel to receive new transactions event
209+ logsCh chan []* types.Log // Channel to receive new log event
210+ rmLogsCh chan core.RemovedLogsEvent // Channel to receive removed log event
211+ chainCh chan core.ChainEvent // Channel to receive new chain event
223212}
224213
225214// NewEventSystem creates a new manager that listens for event on the given mux,
@@ -230,26 +219,24 @@ type EventSystem struct {
230219// or by stopping the given mux.
231220func NewEventSystem (sys * FilterSystem ) * EventSystem {
232221 m := & EventSystem {
233- sys : sys ,
234- backend : sys .backend ,
235- install : make (chan * subscription ),
236- uninstall : make (chan * subscription ),
237- txsCh : make (chan core.NewTxsEvent , txChanSize ),
238- queuedTxsCh : make (chan core.NewQueuedTxsEvent , queuedTxChanSize ),
239- logsCh : make (chan []* types.Log , logsChanSize ),
240- rmLogsCh : make (chan core.RemovedLogsEvent , rmLogsChanSize ),
241- chainCh : make (chan core.ChainEvent , chainEvChanSize ),
222+ sys : sys ,
223+ backend : sys .backend ,
224+ install : make (chan * subscription ),
225+ uninstall : make (chan * subscription ),
226+ txsCh : make (chan core.NewTxsEvent , txChanSize ),
227+ logsCh : make (chan []* types.Log , logsChanSize ),
228+ rmLogsCh : make (chan core.RemovedLogsEvent , rmLogsChanSize ),
229+ chainCh : make (chan core.ChainEvent , chainEvChanSize ),
242230 }
243231
244232 // Subscribe events
245233 m .txsSub = m .backend .SubscribeNewTxsEvent (m .txsCh )
246- m .queuedTxsSub = m .backend .SubscribeNewQueuedTxsEvent (m .queuedTxsCh )
247234 m .logsSub = m .backend .SubscribeLogsEvent (m .logsCh )
248235 m .rmLogsSub = m .backend .SubscribeRemovedLogsEvent (m .rmLogsCh )
249236 m .chainSub = m .backend .SubscribeChainEvent (m .chainCh )
250237
251238 // Make sure none of the subscriptions are empty
252- if m .txsSub == nil || m .queuedTxsSub == nil || m . logsSub == nil || m .rmLogsSub == nil || m .chainSub == nil {
239+ if m .txsSub == nil || m .logsSub == nil || m .rmLogsSub == nil || m .chainSub == nil {
253240 log .Crit ("Subscribe for event system failed" )
254241 }
255242
@@ -284,8 +271,6 @@ func (sub *Subscription) Unsubscribe() {
284271 break uninstallLoop
285272 case <- sub .f .logs :
286273 case <- sub .f .txs :
287- case <- sub .f .hashes :
288- case <- sub .f .queuedTxs :
289274 case <- sub .f .headers :
290275 case <- sub .f .receipts :
291276 }
@@ -372,8 +357,6 @@ func (es *EventSystem) subscribeLogs(crit ethereum.FilterQuery, logs chan []*typ
372357 created : time .Now (),
373358 logs : logs ,
374359 txs : make (chan []* types.Transaction ),
375- hashes : make (chan []common.Hash ),
376- queuedTxs : make (chan []* types.Transaction ),
377360 headers : make (chan * types.Header ),
378361 receipts : make (chan []* ReceiptWithTx ),
379362 installed : make (chan struct {}),
@@ -391,8 +374,6 @@ func (es *EventSystem) SubscribeNewHeads(headers chan *types.Header) *Subscripti
391374 created : time .Now (),
392375 logs : make (chan []* types.Log ),
393376 txs : make (chan []* types.Transaction ),
394- hashes : make (chan []common.Hash ),
395- queuedTxs : make (chan []* types.Transaction ),
396377 headers : headers ,
397378 receipts : make (chan []* ReceiptWithTx ),
398379 installed : make (chan struct {}),
@@ -410,26 +391,7 @@ func (es *EventSystem) SubscribePendingTxs(txs chan []*types.Transaction) *Subsc
410391 created : time .Now (),
411392 logs : make (chan []* types.Log ),
412393 txs : txs ,
413- queuedTxs : make (chan []* types.Transaction ),
414- headers : make (chan * types.Header ),
415- installed : make (chan struct {}),
416- err : make (chan error ),
417- }
418- return es .subscribe (sub )
419- }
420-
421- // SubscribeQueuedTxs creates a subscription that writes transaction hashes for
422- // transactions that enter the transaction pool.
423- func (es * EventSystem ) SubscribeQueuedTxs (queuedTxs chan []* types.Transaction ) * Subscription {
424- sub := & subscription {
425- id : rpc .NewID (),
426- typ : QueuedTransactionsSubscription ,
427- created : time .Now (),
428- logs : make (chan []* types.Log ),
429- hashes : make (chan []common.Hash ),
430- queuedTxs : queuedTxs ,
431394 headers : make (chan * types.Header ),
432- receipts : make (chan []* ReceiptWithTx ),
433395 installed : make (chan struct {}),
434396 err : make (chan error ),
435397 }
@@ -493,20 +455,11 @@ func (es *EventSystem) handleChainEvent(filters filterIndex, ev core.ChainEvent)
493455 }
494456}
495457
496- func (es * EventSystem ) handleQueuedTxsEvent (filters filterIndex , ev core.NewQueuedTxsEvent ) {
497- txs := make ([]* types.Transaction , 0 , len (ev .Txs ))
498- txs = append (txs , ev .Txs ... )
499- for _ , f := range filters [QueuedTransactionsSubscription ] {
500- f .queuedTxs <- txs
501- }
502- }
503-
504458// eventLoop (un)installs filters and processes mux events.
505459func (es * EventSystem ) eventLoop () {
506460 // Ensure all subscriptions get cleaned up
507461 defer func () {
508462 es .txsSub .Unsubscribe ()
509- es .queuedTxsSub .Unsubscribe ()
510463 es .logsSub .Unsubscribe ()
511464 es .rmLogsSub .Unsubscribe ()
512465 es .chainSub .Unsubscribe ()
@@ -521,8 +474,6 @@ func (es *EventSystem) eventLoop() {
521474 select {
522475 case ev := <- es .txsCh :
523476 es .handleTxsEvent (index , ev )
524- case ev := <- es .queuedTxsCh :
525- es .handleQueuedTxsEvent (index , ev )
526477 case ev := <- es .logsCh :
527478 es .handleLogs (index , ev )
528479 case ev := <- es .rmLogsCh :
@@ -541,8 +492,6 @@ func (es *EventSystem) eventLoop() {
541492 // System stopped
542493 case <- es .txsSub .Err ():
543494 return
544- case <- es .queuedTxsSub .Err ():
545- return
546495 case <- es .logsSub .Err ():
547496 return
548497 case <- es .rmLogsSub .Err ():
0 commit comments