diff --git a/go/sentry/client/client.go b/go/sentry/client/client.go index 59a260d100b..6cebdd648d2 100644 --- a/go/sentry/client/client.go +++ b/go/sentry/client/client.go @@ -33,8 +33,6 @@ var ( // Client is a sentry client for querying sentry nodes for their address(es). type Client struct { - ctx context.Context - logger *logging.Logger sentryAddress *node.Address @@ -60,14 +58,14 @@ func (c *Client) Close() { } // GetConsensusAddresses returns the list of sentry node's consensus addresses. -func (c *Client) GetConsensusAddresses() ([]node.ConsensusAddress, error) { +func (c *Client) GetConsensusAddresses(ctx context.Context) ([]node.ConsensusAddress, error) { if c.client == nil { return nil, ErrSentryNotAvailable } var req sentry.GetConsensusAddressesRequest - resp, err := c.client.GetConsensusAddresses(c.ctx, &req) + resp, err := c.client.GetConsensusAddresses(ctx, &req) if err != nil { return nil, err } @@ -116,13 +114,11 @@ func (c *Client) createConnection() error { // New creates a new sentry client. func New( - ctx context.Context, sentryAddress *node.Address, sentryCert *x509.Certificate, nodeIdentity *identity.Identity, ) (*Client, error) { c := &Client{ - ctx: ctx, logger: logging.GetLogger("sentry/client"), sentryAddress: sentryAddress, sentryCert: sentryCert, diff --git a/go/sentry/grpc.go b/go/sentry/grpc.go index 1f83d8cbfd7..326d6aa3c12 100644 --- a/go/sentry/grpc.go +++ b/go/sentry/grpc.go @@ -18,7 +18,7 @@ type grpcServer struct { } func (s *grpcServer) GetConsensusAddresses(ctx context.Context, req *pb.GetConsensusAddressesRequest) (*pb.GetConsensusAddressesResponse, error) { - addresses, err := s.backend.GetConsensusAddresses() + addresses, err := s.backend.GetConsensusAddresses(ctx) if err != nil { return nil, fmt.Errorf("sentry: error obtaining public addresses: %w", err) }