mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-23 05:06:43 +00:00
rm redundant headfeed
This commit is contained in:
parent
3a3c46a39b
commit
3d083d02fd
2 changed files with 4 additions and 6 deletions
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in a new issue