diff --git a/eth/api_backend.go b/eth/api_backend.go index b889e5e224..7c2fa104ae 100644 --- a/eth/api_backend.go +++ b/eth/api_backend.go @@ -152,7 +152,7 @@ func (b *EthAPIBackend) SubscribeChainSideEvent(ch chan<- core.ChainSideEvent) e return b.eth.BlockChain().SubscribeChainSideEvent(ch) } -func (b *EthApiBackend) SubscribeTransactionEvent(ch chan<- core.TransactionEvent) event.Subscription { +func (b *EthAPIBackend) SubscribeTransactionEvent(ch chan<- core.TransactionEvent) event.Subscription { return b.eth.BlockChain().SubscribeTransactionEvent(ch) } diff --git a/eth/filters/filter_system.go b/eth/filters/filter_system.go index a5234bf212..03a492f2d3 100644 --- a/eth/filters/filter_system.go +++ b/eth/filters/filter_system.go @@ -102,7 +102,7 @@ type EventSystem struct { lastHead *types.Header // Subscriptions - txPreSub event.Subscription // Subscription for pre transaction events + txPreSub event.Subscription // Subscription for pre transaction events txSub event.Subscription // Subscription for transaction events logsSub event.Subscription // Subscription for new log event rmLogsSub event.Subscription // Subscription for removed log event @@ -110,13 +110,13 @@ type EventSystem struct { pendingLogSub *event.TypeMuxSubscription // Subscription for pending log event // Channels - install chan *subscription // install filter for event notification - uninstall chan *subscription // remove filter for event notification - txPreCh chan core.TxPreEvent // Channel to recieve new pre transaction events - txCh chan core.TransactionEvent // Channel to receive new transaction events - 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 + install chan *subscription // install filter for event notification + uninstall chan *subscription // remove filter for event notification + txPreCh chan core.TxPreEvent // Channel to receive new pre transaction events + txCh chan core.TransactionEvent // Channel to receive new transaction events + 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 } // NewEventSystem creates a new manager that listens for event on the given mux, @@ -132,7 +132,7 @@ func NewEventSystem(mux *event.TypeMux, backend Backend, lightMode bool) *EventS lightMode: lightMode, install: make(chan *subscription), uninstall: make(chan *subscription), - txPrech: make(chan core.TxPreEvent, txPreChanSize), + txPreCh: make(chan core.TxPreEvent, txPreChanSize), txCh: make(chan core.TransactionEvent, txPostChanSize), logsCh: make(chan []*types.Log, logsChanSize), rmLogsCh: make(chan core.RemovedLogsEvent, rmLogsChanSize), @@ -140,7 +140,7 @@ func NewEventSystem(mux *event.TypeMux, backend Backend, lightMode bool) *EventS } // Subscribe events - m.txPreSub = m.backend.SubscribeTxPreEvent(m.txPreCh) + m.txPreSub = m.backend.SubscribeTxPreEvent(m.txPreCh) m.txSub = m.backend.SubscribeTransactionEvent(m.txCh) m.logsSub = m.backend.SubscribeLogsEvent(m.logsCh) m.rmLogsSub = m.backend.SubscribeRemovedLogsEvent(m.rmLogsCh) @@ -475,7 +475,7 @@ func (es *EventSystem) eventLoop() { // Ensure all subscriptions get cleaned up defer func() { es.pendingLogSub.Unsubscribe() - es.txPreSub.Unsubscribe() + es.txPreSub.Unsubscribe() es.txSub.Unsubscribe() es.logsSub.Unsubscribe() es.rmLogsSub.Unsubscribe() @@ -483,7 +483,7 @@ func (es *EventSystem) eventLoop() { }() index := make(filterIndex) - + for i := UnknownSubscription; i < LastIndexSubscription; i++ { index[i] = make(map[rpc.ID]*subscription) } diff --git a/eth/filters/filter_system_test.go b/eth/filters/filter_system_test.go index 1a68262fe4..3b3de5e742 100644 --- a/eth/filters/filter_system_test.go +++ b/eth/filters/filter_system_test.go @@ -158,7 +158,7 @@ func TestBlockSubscription(t *testing.T) { var ( mux = new(event.TypeMux) - db = ethdb.NewMemDatabase() + db = ethdb.NewMemDatabase() txPreFeed = new(event.Feed) txPostFeed = new(event.Feed) rmLogsFeed = new(event.Feed) @@ -332,7 +332,7 @@ func TestInvalidLogFilterCreation(t *testing.T) { mux = new(event.TypeMux) db = ethdb.NewMemDatabase() txPreFeed = new(event.Feed) - txPostFeed = new(evnt.Feed) + txPostFeed = new(event.Feed) rmLogsFeed = new(event.Feed) logsFeed = new(event.Feed) chainFeed = new(event.Feed) @@ -481,7 +481,7 @@ func TestPendingLogsSubscription(t *testing.T) { var ( mux = new(event.TypeMux) - db = ethdb.NewMemDatabase() + db = ethdb.NewMemDatabase() txPreFeed = new(event.Feed) txPostFeed = new(event.Feed) rmLogsFeed = new(event.Feed)