@@ -185,9 +185,9 @@ type subscription struct {
185185 txs chan []* types.Transaction
186186 headers chan * types.Header
187187 receipts chan []* ReceiptWithTx
188- txHashes [] common.Hash // contains transaction hashes for transactionReceipts subscription filtering
189- installed chan struct {} // closed when the filter is installed
190- err chan error // closed when the filter is uninstalled
188+ txHashes map [ common.Hash ] bool // contains transaction hashes for transactionReceipts subscription filtering
189+ installed chan struct {} // closed when the filter is installed
190+ err chan error // closed when the filter is uninstalled
191191}
192192
193193// EventSystem creates subscriptions, processes events and broadcasts them to the
@@ -403,6 +403,10 @@ func (es *EventSystem) SubscribePendingTxs(txs chan []*types.Transaction) *Subsc
403403// transactions when they are included in blocks. If txHashes is provided, only receipts
404404// for those specific transaction hashes will be delivered.
405405func (es * EventSystem ) SubscribeTransactionReceipts (txHashes []common.Hash , receipts chan []* ReceiptWithTx ) * Subscription {
406+ hashSet := make (map [common.Hash ]bool )
407+ for _ , h := range txHashes {
408+ hashSet [h ] = true
409+ }
406410 sub := & subscription {
407411 id : rpc .NewID (),
408412 typ : TransactionReceiptsSubscription ,
@@ -411,7 +415,7 @@ func (es *EventSystem) SubscribeTransactionReceipts(txHashes []common.Hash, rece
411415 txs : make (chan []* types.Transaction ),
412416 headers : make (chan * types.Header ),
413417 receipts : receipts ,
414- txHashes : txHashes ,
418+ txHashes : hashSet ,
415419 installed : make (chan struct {}),
416420 err : make (chan error ),
417421 }
0 commit comments