Skip to content

Commit

Permalink
Check if rest ch is nil
Browse files Browse the repository at this point in the history
  • Loading branch information
kajeagentspi committed Oct 26, 2022
1 parent fda0c3e commit 066677a
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions relayer/chainproxy/rest.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import (
"github.com/lavanet/lava/relayer/chainproxy/rpcclient"
"github.com/lavanet/lava/relayer/parser"
"github.com/lavanet/lava/relayer/sentry"
"github.com/lavanet/lava/utils"
pairingtypes "github.com/lavanet/lava/x/pairing/types"
spectypes "github.com/lavanet/lava/x/spec/types"
)
Expand Down Expand Up @@ -231,6 +232,9 @@ func (nm *RestMessage) GetServiceApi() *spectypes.ServiceApi {
}

func (nm *RestMessage) Send(ctx context.Context, ch chan interface{}) (relayReply *pairingtypes.RelayReply, subscriptionID string, relayReplyServer *rpcclient.ClientSubscription, err error) {
if ch != nil {
return nil, "", nil, utils.LavaFormatError("Subscribe is not allowed on rest", nil, nil)
}
httpClient := http.Client{
Timeout: DefaultTimeout, // Timeout after 5 seconds
}
Expand Down

0 comments on commit 066677a

Please sign in to comment.