Skip to content

Commit 988f9b2

Browse files
committed
Use chStopInFlight
1 parent 5e53423 commit 988f9b2

File tree

2 files changed

+2
-6
lines changed

2 files changed

+2
-6
lines changed

multinode/adaptor.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,11 +58,11 @@ func (m *Adapter[RPC, HEAD]) LenSubs() int {
5858
}
5959

6060
// RegisterSub adds the sub to the Adaptor list and returns a sub which is managed on unsubscribe
61-
func (m *Adapter[RPC, HEAD]) RegisterSub(sub Subscription, stopInFLightCh chan struct{}) (*ManagedSubscription, error) {
61+
func (m *Adapter[RPC, HEAD]) RegisterSub(sub Subscription) (*ManagedSubscription, error) {
6262
// ensure that the `sub` belongs to current life cycle of the `rpcMultiNodeAdapter` and it should not be killed due to
6363
// previous `DisconnectAll` call.
6464
select {
65-
case <-stopInFLightCh:
65+
case <-m.chStopInFlight:
6666
sub.Unsubscribe()
6767
return nil, fmt.Errorf("failed to register subscription - all in-flight requests were canceled")
6868
default:

multinode/adaptor_test.go

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,6 @@ func LatestBlock(ctx context.Context, rpc *testRPC) (*testHead, error) {
2929
return &testHead{rpc.latestBlock}, nil
3030
}
3131

32-
func ptr[T any](t T) *T {
33-
return &t
34-
}
35-
3632
func newTestClient(t *testing.T) *Adapter[testRPC, *testHead] {
3733
requestTimeout := 5 * time.Second
3834
lggr := logger.Test(t)

0 commit comments

Comments
 (0)