From 32499cf34e79d913cf78192ef101670010becb50 Mon Sep 17 00:00:00 2001 From: Con Kolivas Date: Thu, 5 Jan 2017 11:54:52 +1100 Subject: [PATCH] Failure to get a response to getrawtransaction gives a http error even though it then gives a meaningful response. Drop warning to debug in get_txn. --- src/bitcoin.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/bitcoin.c b/src/bitcoin.c index f6d21694..14e9ad5f 100644 --- a/src/bitcoin.c +++ b/src/bitcoin.c @@ -385,12 +385,12 @@ char *get_txn(connsock_t *cs, const char *hash) ASPRINTF(&rpc_req, "{\"method\": \"getrawtransaction\", \"params\": [\"%s\"]}\n", hash); val = json_rpc_response(cs, rpc_req); dealloc(rpc_req); - if (unlikely(!val)) { - LOGWARNING("%s:%s Failed to get valid json response to get_txn", cs->url, cs->port); + if (!val) { + LOGDEBUG("%s:%s Failed to get valid json response to get_txn", cs->url, cs->port); goto out; } res_val = json_object_get(val, "result"); - if (!json_is_null(res_val) && json_is_string(res_val)) { + if (res_val && !json_is_null(res_val) && json_is_string(res_val)) { ret = strdup(json_string_value(res_val)); LOGDEBUG("get_txn for hash %s got data %s", hash, ret); } else