diff --git a/eth/filters/api.go b/eth/filters/api.go index 61d9b8feee68c..4612e46987192 100644 --- a/eth/filters/api.go +++ b/eth/filters/api.go @@ -136,7 +136,7 @@ func (api *FilterAPI) NewPendingTransactionFilter() rpc.ID { // NewPendingTransactions creates a subscription that is triggered each time a // transaction enters the transaction pool. If fullTx is true the full tx is // sent to the client, otherwise the hash is sent. -func (api *FilterAPI) NewPendingTransactions(ctx context.Context, fullTx bool) (*rpc.Subscription, error) { +func (api *FilterAPI) NewPendingTransactions(ctx context.Context, fullTx *bool) (*rpc.Subscription, error) { notifier, supported := rpc.NotifierFromContext(ctx) if !supported { return &rpc.Subscription{}, rpc.ErrNotificationsUnsupported @@ -154,7 +154,7 @@ func (api *FilterAPI) NewPendingTransactions(ctx context.Context, fullTx bool) ( // To keep the original behaviour, send a single tx hash in one notification. // TODO(rjl493456442) Send a batch of tx hashes in one notification for _, tx := range txs { - if fullTx { + if fullTx != nil && *fullTx { notifier.Notify(rpcSub.ID, tx) } else { notifier.Notify(rpcSub.ID, tx.Hash()) diff --git a/ethclient/gethclient/gethclient.go b/ethclient/gethclient/gethclient.go index bce81ea6b3766..fccaab800da40 100644 --- a/ethclient/gethclient/gethclient.go +++ b/ethclient/gethclient/gethclient.go @@ -182,7 +182,7 @@ func (ec *Client) SubscribePendingTransactions(ctx context.Context, ch chan<- *t // SubscribePendingTransactionHashes subscribes to new pending transaction hashes. func (ec *Client) SubscribePendingTransactionHashes(ctx context.Context, ch chan<- common.Hash) (*rpc.ClientSubscription, error) { - return ec.c.EthSubscribe(ctx, ch, "newPendingTransactions", false) + return ec.c.EthSubscribe(ctx, ch, "newPendingTransactions") } func toBlockNumArg(number *big.Int) string {