File tree Expand file tree Collapse file tree 1 file changed +2
-16
lines changed
Expand file tree Collapse file tree 1 file changed +2
-16
lines changed Original file line number Diff line number Diff line change @@ -437,23 +437,12 @@ func (f *TxFetcher) loop() {
437437 oldHead * types.Header
438438 )
439439
440- //Subscribe to chain events to know when transactions are added to chain
440+ // Subscribe to chain events to know when transactions are added to chain
441441 var headEventCh chan core.ChainEvent
442- var subErr <- chan error
443442 if f .chain != nil {
444443 headEventCh = make (chan core.ChainEvent , 10 )
445444 sub := f .chain .SubscribeChainEvent (headEventCh )
446- subErr = sub .Err ()
447- defer func () {
448- sub .Unsubscribe ()
449- for {
450- select {
451- case <- headEventCh : // drain channel
452- default :
453- return
454- }
455- }
456- }()
445+ defer sub .Unsubscribe ()
457446 }
458447
459448 for {
@@ -895,9 +884,6 @@ func (f *TxFetcher) loop() {
895884 f .txOnChainCache .Add (tx .Hash (), struct {}{})
896885 }
897886
898- case <- subErr :
899- return
900-
901887 case <- f .quit :
902888 return
903889 }
You can’t perform that action at this time.
0 commit comments