eth/filters: remove use of event.TypeMux for pending logs (#20312)
This commit is contained in:
@ -182,3 +182,9 @@ func (miner *Miner) SetEtherbase(addr common.Address) {
|
||||
miner.coinbase = addr
|
||||
miner.worker.setEtherbase(addr)
|
||||
}
|
||||
|
||||
// SubscribePendingLogs starts delivering logs from pending transactions
|
||||
// to the given channel.
|
||||
func (self *Miner) SubscribePendingLogs(ch chan<- []*types.Log) event.Subscription {
|
||||
return self.worker.pendingLogsFeed.Subscribe(ch)
|
||||
}
|
||||
|
@ -128,6 +128,9 @@ type worker struct {
|
||||
eth Backend
|
||||
chain *core.BlockChain
|
||||
|
||||
// Feeds
|
||||
pendingLogsFeed event.Feed
|
||||
|
||||
// Subscriptions
|
||||
mux *event.TypeMux
|
||||
txsCh chan core.NewTxsEvent
|
||||
@ -809,7 +812,7 @@ func (w *worker) commitTransactions(txs *types.TransactionsByPriceAndNonce, coin
|
||||
cpy[i] = new(types.Log)
|
||||
*cpy[i] = *l
|
||||
}
|
||||
go w.mux.Post(core.PendingLogsEvent{Logs: cpy})
|
||||
w.pendingLogsFeed.Send(cpy)
|
||||
}
|
||||
// Notify resubmit loop to decrease resubmitting interval if current interval is larger
|
||||
// than the user-specified one.
|
||||
|
Reference in New Issue
Block a user