rm redundant headfeed

This commit is contained in:
aodhgan 2025-10-09 12:27:49 -07:00
parent 3a3c46a39b
commit 3d083d02fd
2 changed files with 4 additions and 6 deletions

View file

@ -1691,8 +1691,8 @@ func (api *TransactionAPI) SendRawTransactionSync(ctx context.Context, input hex
}
// Subscribe to receipt stream (filtered to this tx)
rcpts := make(chan []*ReceiptWithTx, 1)
sub := api.b.SubscribeTransactionReceipts([]common.Hash{hash}, rcpts)
receipts := make(chan []*ReceiptWithTx, 1)
sub := api.b.SubscribeTransactionReceipts([]common.Hash{hash}, receipts)
defer sub.Unsubscribe()
subErrCh := sub.Err()
@ -1717,7 +1717,7 @@ func (api *TransactionAPI) SendRawTransactionSync(ctx context.Context, input hex
}
return nil, err
case batch := <-rcpts:
case batch := <-receipts:
for _, rwt := range batch {
if rwt == nil || rwt.Receipt == nil || rwt.Receipt.TxHash != hash {
continue

View file

@ -443,7 +443,6 @@ type testBackend struct {
// test-only fields for SendRawTransactionSync
receiptsFeed *event.Feed
headFeed *event.Feed // keep if other tests use it; otherwise remove
autoMine bool
sentTx *types.Transaction
@ -481,7 +480,6 @@ func newTestBackend(t *testing.T, n int, gspec *core.Genesis, engine consensus.E
acc: acc,
pending: blocks[n],
pendingReceipts: receipts[n],
headFeed: new(event.Feed),
receiptsFeed: new(event.Feed),
}
return backend
@ -607,7 +605,7 @@ func (b testBackend) SubscribeChainEvent(ch chan<- core.ChainEvent) event.Subscr
panic("implement me")
}
func (b testBackend) SubscribeChainHeadEvent(ch chan<- core.ChainHeadEvent) event.Subscription {
return b.headFeed.Subscribe(ch)
panic("implement me")
}
func (b *testBackend) SendTx(ctx context.Context, tx *types.Transaction) error {
b.sentTx = tx