From edd79bd8fa970333f407e1f07d0d0695954084fe Mon Sep 17 00:00:00 2001 From: Con Kolivas Date: Tue, 15 Dec 2015 12:17:58 +1100 Subject: [PATCH] Elaborate which bitcoind has failed responses --- src/bitcoin.c | 12 ++++++------ src/generator.c | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/bitcoin.c b/src/bitcoin.c index 88e37817..48052684 100644 --- a/src/bitcoin.c +++ b/src/bitcoin.c @@ -54,7 +54,7 @@ bool validate_address(connsock_t *cs, const char *address) snprintf(rpc_req, 128, "{\"method\": \"validateaddress\", \"params\": [\"%s\"]}\n", address); val = json_rpc_call(cs, rpc_req); if (!val) { - LOGERR("Failed to get valid json response to validate_address"); + LOGERR("%s:%s Failed to get valid json response to validate_address", cs->url, cs->port); return ret; } res_val = json_object_get(val, "result"); @@ -194,7 +194,7 @@ bool gen_gbtbase(connsock_t *cs, gbtbase_t *gbt) val = json_rpc_call(cs, gbt_req); if (!val) { - LOGWARNING("Failed to get valid json response to getblocktemplate"); + LOGWARNING("%s:%s Failed to get valid json response to getblocktemplate", cs->url, cs->port); return ret; } res_val = json_object_get(val, "result"); @@ -299,7 +299,7 @@ int get_blockcount(connsock_t *cs) val = json_rpc_call(cs, blockcount_req); if (!val) { - LOGWARNING("Failed to get valid json response to getblockcount"); + LOGWARNING("%s:%s Failed to get valid json response to getblockcount", cs->url, cs->port); return ret; } res_val = json_object_get(val, "result"); @@ -325,7 +325,7 @@ bool get_blockhash(connsock_t *cs, int height, char *hash) sprintf(rpc_req, "{\"method\": \"getblockhash\", \"params\": [%d]}\n", height); val = json_rpc_call(cs, rpc_req); if (!val) { - LOGWARNING("Failed to get valid json response to getblockhash"); + LOGWARNING("%s:%s Failed to get valid json response to getblockhash", cs->url, cs->port); return ret; } res_val = json_object_get(val, "result"); @@ -356,7 +356,7 @@ bool get_bestblockhash(connsock_t *cs, char *hash) val = json_rpc_call(cs, bestblockhash_req); if (!val) { - LOGWARNING("Failed to get valid json response to getbestblockhash"); + LOGWARNING("%s:%s Failed to get valid json response to getbestblockhash", cs->url, cs->port); return ret; } res_val = json_object_get(val, "result"); @@ -391,7 +391,7 @@ retry: val = json_rpc_call(cs, rpc_req); dealloc(rpc_req); if (!val) { - LOGWARNING("Failed to get valid json response to submitblock"); + LOGWARNING("%s:%s Failed to get valid json response to submitblock", cs->url, cs->port); if (++retries < 5) goto retry; return ret; diff --git a/src/generator.c b/src/generator.c index 9419a6bd..7d1dc1a0 100644 --- a/src/generator.c +++ b/src/generator.c @@ -302,7 +302,7 @@ retry: } while (selret < 1); if (unlikely(cs->fd < 0)) { - LOGWARNING("Bitcoind socket invalidated, will attempt failover"); + LOGWARNING("%s:%s Bitcoind socket invalidated, will attempt failover", cs->url, cs->port); goto reconnect; }