From e9f49d50a5ded3a46e260698b272d48d88f5e696 Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 21 Nov 2016 12:18:20 -0300 Subject: [PATCH] test --- src/komodo_bitcoind.h | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/komodo_bitcoind.h b/src/komodo_bitcoind.h index 8267135d9..2cdd9ba20 100644 --- a/src/komodo_bitcoind.h +++ b/src/komodo_bitcoind.h @@ -348,7 +348,7 @@ char *komodo_issuemethod(char *userpass,char *method,char *params,uint16_t port) uint256 komodo_getblockhash(int32_t height) { - uint256 hash; char params[128],*hexstr,*jsonstr; cJSON *result; + uint256 hash; char params[128],*hexstr,*jsonstr; cJSON *result; uint8_t revbuf[32]; memset(&hash,0,sizeof(hash)); sprintf(params,"[%d]",height); if ( (jsonstr= komodo_issuemethod(KMDUSERPASS,(char *)"getblockhash",params,7771)) != 0 ) @@ -358,7 +358,11 @@ uint256 komodo_getblockhash(int32_t height) if ( (hexstr= jstr(result,(char *)"result")) != 0 ) { if ( is_hexstr(hexstr,0) == 64 ) - decode_hex((uint8_t *)&hash,32,hexstr); + { + decode_hex(revbuf,32,hexstr); + for (i=0; i<32; i++) + ((uint8_t *)&hash)[i] = revbuf[31-i]; + } } free_json(result); }