Skip to content

Commit b9ebb6c

Browse files
authored
feat: add fullTx params to NewPendingTransactions (#9204)
feat: add `fullTx` params to `NewPendingTransactions` Closes #9203
1 parent 341bfea commit b9ebb6c

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

turbo/jsonrpc/eth_filters.go

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ func (api *APIImpl) NewHeads(ctx context.Context) (*rpc.Subscription, error) {
162162
}
163163

164164
// NewPendingTransactions send a notification each time when a transaction had added into mempool.
165-
func (api *APIImpl) NewPendingTransactions(ctx context.Context) (*rpc.Subscription, error) {
165+
func (api *APIImpl) NewPendingTransactions(ctx context.Context, fullTx *bool) (*rpc.Subscription, error) {
166166
if api.filters == nil {
167167
return &rpc.Subscription{}, rpc.ErrNotificationsUnsupported
168168
}
@@ -183,7 +183,13 @@ func (api *APIImpl) NewPendingTransactions(ctx context.Context) (*rpc.Subscripti
183183
case txs, ok := <-txsCh:
184184
for _, t := range txs {
185185
if t != nil {
186-
err := notifier.Notify(rpcSub.ID, t.Hash())
186+
var err error
187+
if fullTx != nil && *fullTx {
188+
err = notifier.Notify(rpcSub.ID, t)
189+
} else {
190+
err = notifier.Notify(rpcSub.ID, t.Hash())
191+
}
192+
187193
if err != nil {
188194
log.Warn("[rpc] error while notifying subscription", "err", err)
189195
}

0 commit comments

Comments
 (0)