Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add fullTx params to NewPendingTransactions #9204

Merged
merged 4 commits into from
Apr 25, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions turbo/jsonrpc/eth_filters.go
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ func (api *APIImpl) NewHeads(ctx context.Context) (*rpc.Subscription, error) {
}

// NewPendingTransactions send a notification each time when a transaction had added into mempool.
func (api *APIImpl) NewPendingTransactions(ctx context.Context) (*rpc.Subscription, error) {
func (api *APIImpl) NewPendingTransactions(ctx context.Context, fullTx *bool) (*rpc.Subscription, error) {
if api.filters == nil {
return &rpc.Subscription{}, rpc.ErrNotificationsUnsupported
}
Expand All @@ -183,7 +183,13 @@ func (api *APIImpl) NewPendingTransactions(ctx context.Context) (*rpc.Subscripti
case txs, ok := <-txsCh:
for _, t := range txs {
if t != nil {
err := notifier.Notify(rpcSub.ID, t.Hash())
var err error
if fullTx != nil && *fullTx {
err = notifier.Notify(rpcSub.ID, t)
} else {
err = notifier.Notify(rpcSub.ID, t.Hash())
}

if err != nil {
log.Warn("[rpc] error while notifying subscription", "err", err)
}
Expand Down
Loading