Skip to content

Commit

Permalink
made fullTx arg optional to keep backwards compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
lmittmann committed Jun 28, 2022
1 parent e36519c commit 4a69d76
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions eth/filters/api.go
Expand Up @@ -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
Expand All @@ -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())
Expand Down
2 changes: 1 addition & 1 deletion ethclient/gethclient/gethclient.go
Expand Up @@ -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 {
Expand Down

0 comments on commit 4a69d76

Please sign in to comment.