MCPcopy Create free account
hub / github.com/CPChain/chain / subscribeLogs

Method subscribeLogs

protocols/cpc/filters/filter_system.go:253–266  ·  view source on GitHub ↗

subscribeLogs creates a subscription that will write all logs matching the given criteria to the given logs channel.

(crit cpchain.FilterQuery, logs chan []*types.Log)

Source from the content-addressed store, hash-verified

251// subscribeLogs creates a subscription that will write all logs matching the
252// given criteria to the given logs channel.
253func (es *EventSystem) subscribeLogs(crit cpchain.FilterQuery, logs chan []*types.Log) *Subscription {
254 sub := &subscription{
255 id: rpc.NewID(),
256 typ: LogsSubscription,
257 logsCrit: crit,
258 created: time.Now(),
259 logs: logs,
260 hashes: make(chan []common.Hash),
261 headers: make(chan *types.Header),
262 installed: make(chan struct{}),
263 err: make(chan error),
264 }
265 return es.subscribe(sub)
266}
267
268// subscribePendingLogs creates a subscription that writes transaction hashes for
269// transactions that enter the transaction pool.

Callers 1

SubscribeLogsMethod · 0.95

Calls 2

subscribeMethod · 0.95
NowMethod · 0.65

Tested by

no test coverage detected