Skip to content

Commit 2f40c06

Browse files
committed
fix comments
1 parent b02df2d commit 2f40c06

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

eth/filters/filter.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -563,7 +563,7 @@ type ReceiptWithTx struct {
563563
// In addition to returning receipts, it also returns the corresponding transactions.
564564
// This is because receipts only contain low-level data, while user-facing data
565565
// may require additional information from the Transaction.
566-
func filterReceipts(txHashMap map[common.Hash]bool, ev core.ChainEvent) []*ReceiptWithTx {
566+
func filterReceipts(txHashes map[common.Hash]bool, ev core.ChainEvent) []*ReceiptWithTx {
567567
var ret []*ReceiptWithTx
568568

569569
receipts := ev.Receipts
@@ -574,7 +574,7 @@ func filterReceipts(txHashMap map[common.Hash]bool, ev core.ChainEvent) []*Recei
574574
return ret
575575
}
576576

577-
if len(txHashMap) == 0 {
577+
if len(txHashes) == 0 {
578578
// No filter, send all receipts with their transactions.
579579
ret = make([]*ReceiptWithTx, len(receipts))
580580
for i, receipt := range receipts {
@@ -585,14 +585,14 @@ func filterReceipts(txHashMap map[common.Hash]bool, ev core.ChainEvent) []*Recei
585585
}
586586
} else {
587587
for i, receipt := range receipts {
588-
if txHashMap[receipt.TxHash] {
588+
if txHashes[receipt.TxHash] {
589589
ret = append(ret, &ReceiptWithTx{
590590
Receipt: receipt,
591591
Transaction: txs[i],
592592
})
593593

594594
// Early exit if all receipts are found
595-
if len(ret) == len(txHashMap) {
595+
if len(ret) == len(txHashes) {
596596
break
597597
}
598598
}

eth/filters/filter_system.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ type subscription struct {
185185
txs chan []*types.Transaction
186186
headers chan *types.Header
187187
receipts chan []*ReceiptWithTx
188-
hashSet map[common.Hash]bool // contains transaction hashes for transactionReceipts subscription filtering
188+
txHashes map[common.Hash]bool // contains transaction hashes for transactionReceipts subscription filtering
189189
installed chan struct{} // closed when the filter is installed
190190
err chan error // closed when the filter is uninstalled
191191
}
@@ -415,7 +415,7 @@ func (es *EventSystem) SubscribeTransactionReceipts(txHashes []common.Hash, rece
415415
txs: make(chan []*types.Transaction),
416416
headers: make(chan *types.Header),
417417
receipts: receipts,
418-
hashSet: hashSet,
418+
txHashes: hashSet,
419419
installed: make(chan struct{}),
420420
err: make(chan error),
421421
}
@@ -449,7 +449,7 @@ func (es *EventSystem) handleChainEvent(filters filterIndex, ev core.ChainEvent)
449449

450450
// Handle transaction receipts subscriptions when a new block is added
451451
for _, f := range filters[TransactionReceiptsSubscription] {
452-
matchedReceipts := filterReceipts(f.hashSet, ev)
452+
matchedReceipts := filterReceipts(f.txHashes, ev)
453453
if len(matchedReceipts) > 0 {
454454
f.receipts <- matchedReceipts
455455
}

0 commit comments

Comments
 (0)