From eac64a5975ba39662eb2caa1426d6d8d9eddde5a Mon Sep 17 00:00:00 2001 From: John Drogo Date: Mon, 27 Jun 2016 22:36:21 -0400 Subject: [PATCH 1/2] Update API endpoints for V1.0 --- network.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/network.c b/network.c index ff12eff..64c24e2 100644 --- a/network.c +++ b/network.c @@ -43,8 +43,8 @@ int check_http_response(CURL *curl) { void set_host(char *host, char *port) { bfw_url = malloc(21 + strlen(host) + strlen(port)); submit_url = malloc(20 + strlen(host) + strlen(port)); - sprintf(bfw_url, "%s%s/miner/headerforwork", host, port); - sprintf(submit_url, "%s%s/miner/submitheader", host, port); + sprintf(bfw_url, "%s%s/miner/header", host, port); + sprintf(submit_url, "%s%s/miner/header", host, port); } // Write network data to a buffer (inBuf) From 5ac98ab7e02220588d0beb0124e82a198ed69df1 Mon Sep 17 00:00:00 2001 From: John Drogo Date: Tue, 28 Jun 2016 01:43:41 -0400 Subject: [PATCH 2/2] Add checks for any 2xx http code for success --- network.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/network.c b/network.c index 64c24e2..2f6af0d 100644 --- a/network.c +++ b/network.c @@ -32,7 +32,7 @@ int check_http_response(CURL *curl) { if (http_code == 400) { fprintf(stderr, "HTTP error %lu - check that the wallet is unlocked\n", http_code); return 1; - } else if (http_code != 200) { + } else if (http_code < 200 || http_code > 299) { fprintf(stderr, "HTTP error %lu\n", http_code); return 1; }