mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-24 05:36:46 +00:00
modify the logs
This commit is contained in:
parent
c3ef6c77c2
commit
a737ea1ba1
1 changed files with 0 additions and 17 deletions
|
|
@ -473,24 +473,7 @@ func (c *BoundContract) FilterLogs(opts *FilterOpts, name string, query ...[]any
|
|||
if opts.End != nil {
|
||||
config.ToBlock = new(big.Int).SetUint64(*opts.End)
|
||||
}
|
||||
/* TODO(karalabe): Replace the rest of the method below with this when supported
|
||||
sub, err := c.filterer.SubscribeFilterLogs(ensureContext(opts.Context), config, logs)
|
||||
*/
|
||||
buff, err := c.filterer.FilterLogs(ensureContext(opts.Context), config)
|
||||
if err != nil {
|
||||
return nil, nil, err
|
||||
}
|
||||
sub := event.NewSubscription(func(quit <-chan struct{}) error {
|
||||
for _, log := range buff {
|
||||
select {
|
||||
case logs <- log:
|
||||
case <-quit:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
return nil
|
||||
})
|
||||
|
||||
return logs, sub, nil
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue