@@ -76,10 +76,6 @@ status_t send_transaction_information(const char* host, const char* port, const
76
76
77
77
const char * ta_host = host ? host : STR (EP_TA_HOST );
78
78
const char * ta_port = port ? port : STR (EP_TA_PORT );
79
- char ipv4 [NI_MAXHOST ];
80
- if (resolve_ip_address (ta_host , ipv4 ) != SC_OK ) {
81
- return SC_ENDPOINT_DNS_RESOLVE_ERROR ;
82
- }
83
79
84
80
const char * seed = ssl_seed ? ssl_seed : STR (EP_SSL_SEED );
85
81
@@ -122,46 +118,10 @@ status_t send_transaction_information(const char* host, const char* port, const
122
118
return SC_ENDPOINT_SEND_TRANSFER ;
123
119
}
124
120
125
- if (send_https_msg (ipv4 , ta_port , SEND_TRANSACTION_API , req_body , seed ) != SC_OK ) {
121
+ if (send_https_msg (ta_host , ta_port , SEND_TRANSACTION_API , req_body , seed ) != SC_OK ) {
126
122
ta_log_error ("http message sending error.\n" );
127
123
return SC_ENDPOINT_SEND_TRANSFER ;
128
124
}
129
125
130
126
return SC_OK ;
131
127
}
132
-
133
- status_t resolve_ip_address (const char * host , char * result ) {
134
- struct addrinfo hints ;
135
- struct addrinfo * res ;
136
-
137
- /* Obtain address(es) matching host */
138
- memset (result , 0 , 16 );
139
- memset (& hints , 0 , sizeof (struct addrinfo ));
140
- hints .ai_family = AF_INET ; /* Allow IPV4 format */
141
- hints .ai_socktype = SOCK_DGRAM ; /* Datagram socket */
142
-
143
- int ret = getaddrinfo (host , NULL , & hints , & res );
144
- if (ret != 0 ) {
145
- ta_log_error ("Getaddrinfo returned: %s\n" , gai_strerror (ret ));
146
- return SC_ENDPOINT_DNS_RESOLVE_ERROR ;
147
- }
148
-
149
- if (res == NULL ) { /* No address succeeded */
150
- ta_log_error ("Could not resolve host: %s\n" , host );
151
- return SC_ENDPOINT_DNS_RESOLVE_ERROR ;
152
- }
153
-
154
- for (struct addrinfo * re = res ; res != NULL ; re = re -> ai_next ) {
155
- char host_buf [NI_MAXHOST ];
156
- int ret = getnameinfo (re -> ai_addr , re -> ai_addrlen , host_buf , sizeof (host_buf ), NULL , 0 , NI_NUMERICHOST );
157
- if (ret == 0 ) {
158
- snprintf (result , NI_MAXHOST , "%s" , host_buf );
159
- break ;
160
- } else {
161
- ta_log_error ("Getnameinfo returned: %s\n" , gai_strerror (ret ));
162
- }
163
- }
164
- freeaddrinfo (res ); /* No longer needed */
165
-
166
- return SC_OK ;
167
- }
0 commit comments