]> Git Repo - VerusCoin.git/commitdiff
test
authorjl777 <[email protected]>
Mon, 21 Nov 2016 15:18:20 +0000 (12:18 -0300)
committerjl777 <[email protected]>
Mon, 21 Nov 2016 15:18:20 +0000 (12:18 -0300)
src/komodo_bitcoind.h

index 8267135d9e925229c3792d40c7c566199a128af8..2cdd9ba209ede6986fd4b56fc564503c949991f2 100644 (file)
@@ -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);
         }
This page took 0.026554 seconds and 4 git commands to generate.