Skip to content

Commit c67535d

Browse files
shufpsPmaxsd
authored andcommitted
Fix sv2 pubkeys (#669)
* removed unused ternary condition, it might have done weird things
1 parent 91b451d commit c67535d

1 file changed

Lines changed: 9 additions & 8 deletions

File tree

main/http_server/handler_system.cpp

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,10 @@ esp_err_t GET_system_info(httpd_req_t *req)
9292
char *fallbackStratumURL = Config::getStratumFallbackURL();
9393
char *fallbackStratumUser= Config::getStratumFallbackUser();
9494

95+
char *sv2_auth = Config::getSV2AuthorityPubkey();
96+
char *fb_sv2_auth = Config::getFallbackSV2AuthorityPubkey();
97+
98+
9599
// static
96100
doc["asicCount"] = board->getAsicCount();
97101
doc["smallCoreCount"] = (board->getAsics()) ? board->getAsics()->getSmallCoreCount() : 0;
@@ -210,14 +214,8 @@ esp_err_t GET_system_info(httpd_req_t *req)
210214
doc["fallbackStratumTLS"] = Config::isStratumFallbackTLS();
211215
doc["stratumProtocol"] = Config::getStratumProtocol();
212216
doc["fallbackStratumProtocol"] = Config::getFallbackStratumProtocol();
213-
{
214-
char *sv2_auth = Config::getSV2AuthorityPubkey();
215-
doc["sv2AuthorityPubkey"] = sv2_auth ? sv2_auth : "";
216-
safe_free(sv2_auth);
217-
char *fb_sv2_auth = Config::getFallbackSV2AuthorityPubkey();
218-
doc["fallbackSv2AuthorityPubkey"] = fb_sv2_auth ? fb_sv2_auth : "";
219-
safe_free(fb_sv2_auth);
220-
}
217+
doc["sv2AuthorityPubkey"] = sv2_auth;
218+
doc["fallbackSv2AuthorityPubkey"] = fb_sv2_auth;
221219
doc["sv2ChannelType"] = Config::getSV2ChannelType();
222220
doc["fallbackSv2ChannelType"] = Config::getFallbackSV2ChannelType();
223221
doc["voltage"] = POWER_MANAGEMENT_MODULE.getVoltage();
@@ -264,6 +262,9 @@ esp_err_t GET_system_info(httpd_req_t *req)
264262
free(fallbackStratumURL);
265263
free(fallbackStratumUser);
266264

265+
free(sv2_auth);
266+
free(fb_sv2_auth);
267+
267268
return ret;
268269
}
269270

0 commit comments

Comments
 (0)