diff --git a/src/cc/dapps/oraclefeed.c b/src/cc/dapps/oraclefeed.c index 521905e18..46c2a305b 100644 --- a/src/cc/dapps/oraclefeed.c +++ b/src/cc/dapps/oraclefeed.c @@ -19,7 +19,6 @@ #include #include "cJSON.c" - char hexbyte(int32_t c) { c &= 0xf; @@ -452,9 +451,9 @@ int32_t get_oracledata(int32_t prevheight,char *hexstr,int32_t maxsize,char *for for (i=0; i<4; i++) sprintf(&hexstr[i*2],"%02x",(uint8_t)((height >> (i*8)) & 0xff)); for (i=0; i<32; i++) - sprintf(&hexstr[8 + i*2],"%02x",blockhash.bytes[i]); + sprintf(&hexstr[8 + (31-i)*2],"%02x",blockhash.bytes[i]); for (i=0; i<32; i++) - sprintf(&hexstr[8 + 64 + i*2],"%02x",merkleroot.bytes[i]); + sprintf(&hexstr[8 + 64 + (31-i)*2],"%02x",merkleroot.bytes[i]); hexstr[8 + 64*2] = 0; return(height); } diff --git a/src/cc/oracles.cpp b/src/cc/oracles.cpp index c6fb58759..ba1b148c3 100644 --- a/src/cc/oracles.cpp +++ b/src/cc/oracles.cpp @@ -283,9 +283,11 @@ uint256 OraclesBatontxid(uint256 reforacletxid,CPubKey refpk) batontxid = zeroid; cp = CCinit(&C,EVAL_ORACLES); SetCCunspents(unspentOutputs,markeraddr); + char str[67]; fprintf(stderr,"markeraddr.(%s) %s\n",markeraddr,pubkey33_str(str,(uint8_t *)&refpk)); for (std::vector >::const_iterator it=unspentOutputs.begin(); it!=unspentOutputs.end(); it++) { txid = it->first.txhash; + fprintf(stderr,"check %s\n",uint256_str(str,txid)); height = (int32_t)it->second.blockHeight; if ( myGetTransaction(txid,regtx,hash) != 0 ) {