Skip to content

Commit 4a69d76

Browse files
committed
made fullTx arg optional to keep backwards compatibility
1 parent e36519c commit 4a69d76

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

eth/filters/api.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ func (api *FilterAPI) NewPendingTransactionFilter() rpc.ID {
136136
// NewPendingTransactions creates a subscription that is triggered each time a
137137
// transaction enters the transaction pool. If fullTx is true the full tx is
138138
// sent to the client, otherwise the hash is sent.
139-
func (api *FilterAPI) NewPendingTransactions(ctx context.Context, fullTx bool) (*rpc.Subscription, error) {
139+
func (api *FilterAPI) NewPendingTransactions(ctx context.Context, fullTx *bool) (*rpc.Subscription, error) {
140140
notifier, supported := rpc.NotifierFromContext(ctx)
141141
if !supported {
142142
return &rpc.Subscription{}, rpc.ErrNotificationsUnsupported
@@ -154,7 +154,7 @@ func (api *FilterAPI) NewPendingTransactions(ctx context.Context, fullTx bool) (
154154
// To keep the original behaviour, send a single tx hash in one notification.
155155
// TODO(rjl493456442) Send a batch of tx hashes in one notification
156156
for _, tx := range txs {
157-
if fullTx {
157+
if fullTx != nil && *fullTx {
158158
notifier.Notify(rpcSub.ID, tx)
159159
} else {
160160
notifier.Notify(rpcSub.ID, tx.Hash())

ethclient/gethclient/gethclient.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ func (ec *Client) SubscribePendingTransactions(ctx context.Context, ch chan<- *t
182182

183183
// SubscribePendingTransactionHashes subscribes to new pending transaction hashes.
184184
func (ec *Client) SubscribePendingTransactionHashes(ctx context.Context, ch chan<- common.Hash) (*rpc.ClientSubscription, error) {
185-
return ec.c.EthSubscribe(ctx, ch, "newPendingTransactions", false)
185+
return ec.c.EthSubscribe(ctx, ch, "newPendingTransactions")
186186
}
187187

188188
func toBlockNumArg(number *big.Int) string {

0 commit comments

Comments
 (0)