diff options
author | Péter Szilágyi <peterke@gmail.com> | 2018-05-18 16:45:52 +0800 |
---|---|---|
committer | Péter Szilágyi <peterke@gmail.com> | 2018-05-18 17:08:24 +0800 |
commit | 49719e21bcd740c5890334f8c0ec8ac3777fb4c6 (patch) | |
tree | 81caf3f5e52d25597f16a21b61b4d91ee4e023b0 /eth/filters/filter_system.go | |
parent | a2e43d28d01ef9642c7f6992b78b86bd0696c847 (diff) | |
download | go-tangerine-49719e21bcd740c5890334f8c0ec8ac3777fb4c6.tar go-tangerine-49719e21bcd740c5890334f8c0ec8ac3777fb4c6.tar.gz go-tangerine-49719e21bcd740c5890334f8c0ec8ac3777fb4c6.tar.bz2 go-tangerine-49719e21bcd740c5890334f8c0ec8ac3777fb4c6.tar.lz go-tangerine-49719e21bcd740c5890334f8c0ec8ac3777fb4c6.tar.xz go-tangerine-49719e21bcd740c5890334f8c0ec8ac3777fb4c6.tar.zst go-tangerine-49719e21bcd740c5890334f8c0ec8ac3777fb4c6.zip |
core, eth: minor txpool event cleanups
Diffstat (limited to 'eth/filters/filter_system.go')
-rw-r--r-- | eth/filters/filter_system.go | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/eth/filters/filter_system.go b/eth/filters/filter_system.go index 5f1c12c6a..4e999cda8 100644 --- a/eth/filters/filter_system.go +++ b/eth/filters/filter_system.go @@ -59,7 +59,7 @@ const ( const ( - // txChanSize is the size of channel listening to TxsPreEvent. + // txChanSize is the size of channel listening to NewTxsEvent. // The number is referenced from the size of tx pool. txChanSize = 4096 // rmLogsChanSize is the size of channel listening to RemovedLogsEvent. @@ -104,7 +104,7 @@ type EventSystem struct { // Channels install chan *subscription // install filter for event notification uninstall chan *subscription // remove filter for event notification - txsCh chan core.TxsPreEvent // Channel to receive new transactions event + txsCh chan core.NewTxsEvent // Channel to receive new transactions event logsCh chan []*types.Log // Channel to receive new log event rmLogsCh chan core.RemovedLogsEvent // Channel to receive removed log event chainCh chan core.ChainEvent // Channel to receive new chain event @@ -123,14 +123,14 @@ func NewEventSystem(mux *event.TypeMux, backend Backend, lightMode bool) *EventS lightMode: lightMode, install: make(chan *subscription), uninstall: make(chan *subscription), - txsCh: make(chan core.TxsPreEvent, txChanSize), + txsCh: make(chan core.NewTxsEvent, txChanSize), logsCh: make(chan []*types.Log, logsChanSize), rmLogsCh: make(chan core.RemovedLogsEvent, rmLogsChanSize), chainCh: make(chan core.ChainEvent, chainEvChanSize), } // Subscribe events - m.txsSub = m.backend.SubscribeTxPreEvent(m.txsCh) + m.txsSub = m.backend.SubscribeNewTxsEvent(m.txsCh) m.logsSub = m.backend.SubscribeLogsEvent(m.logsCh) m.rmLogsSub = m.backend.SubscribeRemovedLogsEvent(m.rmLogsCh) m.chainSub = m.backend.SubscribeChainEvent(m.chainCh) @@ -298,9 +298,9 @@ func (es *EventSystem) SubscribeNewHeads(headers chan *types.Header) *Subscripti return es.subscribe(sub) } -// SubscribePendingTxEvents creates a subscription that writes transaction hashes for +// SubscribePendingTxs creates a subscription that writes transaction hashes for // transactions that enter the transaction pool. -func (es *EventSystem) SubscribePendingTxEvents(hashes chan []common.Hash) *Subscription { +func (es *EventSystem) SubscribePendingTxs(hashes chan []common.Hash) *Subscription { sub := &subscription{ id: rpc.NewID(), typ: PendingTransactionsSubscription, @@ -348,8 +348,8 @@ func (es *EventSystem) broadcast(filters filterIndex, ev interface{}) { } } } - case core.TxsPreEvent: - hashes := make([]common.Hash, 0, e.Txs.Len()) + case core.NewTxsEvent: + hashes := make([]common.Hash, 0, len(e.Txs)) for _, tx := range e.Txs { hashes = append(hashes, tx.Hash()) } |