mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-23 13:16:42 +00:00
eth/filters: subscribe pending logs
Signed-off-by: jsvisa <delweng@gmail.com>
This commit is contained in:
parent
223f05ff76
commit
7f3b72fe10
1 changed files with 2 additions and 2 deletions
|
|
@ -284,12 +284,12 @@ func (api *FilterAPI) logs(ctx context.Context, notifier notifier, rpcSub *rpc.S
|
||||||
to = rpc.BlockNumber(crit.ToBlock.Int64())
|
to = rpc.BlockNumber(crit.ToBlock.Int64())
|
||||||
}
|
}
|
||||||
|
|
||||||
if to != rpc.LatestBlockNumber {
|
if to != rpc.LatestBlockNumber && to != rpc.PendingBlockNumber {
|
||||||
return errInvalidToBlock
|
return errInvalidToBlock
|
||||||
}
|
}
|
||||||
|
|
||||||
// do live filter only
|
// do live filter only
|
||||||
if from == rpc.LatestBlockNumber {
|
if from == rpc.LatestBlockNumber || from == rpc.PendingBlockNumber {
|
||||||
return api.liveLogs(ctx, notifier, rpcSub, crit)
|
return api.liveLogs(ctx, notifier, rpcSub, crit)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue