From 3ec274b4a56d7b09fa49ca8c188709bc0d4eefe4 Mon Sep 17 00:00:00 2001 From: Artem Pikulin Date: Mon, 2 Jul 2018 18:03:00 +0700 Subject: [PATCH] #89 Properly log "error" field from ETH node response. --- etomic_build/enable | 3 +-- etomic_build/userpass | 2 +- iguana/exchanges/etomicswap/etomiccurl.c | 2 +- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/etomic_build/enable b/etomic_build/enable index 0bcf62166..f43d63ff7 100755 --- a/etomic_build/enable +++ b/etomic_build/enable @@ -1,5 +1,4 @@ #!/bin/bash source userpass -curl --url "http://127.0.0.1:7783" --data "{\"userpass\":\"$userpass\",\"method\":\"enable\",\"coin\":\"ETH\"}" -curl --url "http://127.0.0.1:7783" --data "{\"userpass\":\"$userpass\",\"method\":\"enable\",\"coin\":\"KMD\"}" curl --url "http://127.0.0.1:7783" --data "{\"userpass\":\"$userpass\",\"method\":\"enable\",\"coin\":\"ETOMIC\"}" +curl --url "http://127.0.0.1:7783" --data "{\"userpass\":\"$userpass\",\"method\":\"enable\",\"coin\":\"ETH\"}" diff --git a/etomic_build/userpass b/etomic_build/userpass index d097e0445..19fc21189 100644 --- a/etomic_build/userpass +++ b/etomic_build/userpass @@ -1,2 +1,2 @@ #export userpass="" -export userpass="c3d8c2a364b7d18c1f9d7321d017b92e9f9c791e4f5c741214fefdea8a071256" +export userpass="$USERPASS" diff --git a/iguana/exchanges/etomicswap/etomiccurl.c b/iguana/exchanges/etomicswap/etomiccurl.c index a43e2c292..a547111e0 100644 --- a/iguana/exchanges/etomicswap/etomiccurl.c +++ b/iguana/exchanges/etomicswap/etomiccurl.c @@ -43,7 +43,7 @@ cJSON *parseEthRpcResponse(char *requestResult) cJSON *tmp = cJSON_GetObjectItem(json, "result"); cJSON *error = cJSON_GetObjectItem(json, "error"); cJSON *result = NULL; - if (!is_cJSON_Null(tmp)) { + if (tmp != NULL && !is_cJSON_Null(tmp)) { result = cJSON_Duplicate(tmp, 1); } else if (error != NULL && !is_cJSON_Null(error)) { char *errorString = cJSON_PrintUnformatted(error);