@ -325,9 +325,6 @@ int32_t decode_hex(unsigned char *bytes,int32_t n,char *hex)
bytes[0] = unhex(hex[0]);
printf("decode_hex n.%d hex[0] (%c) -> %d hex.(%s) [n*2+1: %d] [n*2: %d %c] len.%ld\n",n,hex[0],bytes[0],hex,hex[n*2+1],hex[n*2],hex[n*2],(long)strlen(hex));
}
#ifdef __APPLE__
getchar();
#endif
bytes++;
hex++;
adjust = 1;
@ -189,8 +189,11 @@ STRING_ARG(bitcoinrpc,decoderawtransaction,rawtx)
{
cJSON *txobj; bits256 txid;
if ( rawtx != 0 && rawtx[0] != 0 )
if ( (strlen(rawtx) & 1) != 0 )
return(clonestr("{\"error\":\"rawtx hex has odd length\"}"));
txobj = bitcoin_hex2json(coin,&txid,0,rawtx);
else txobj = cJSON_CreateObject();
} else txobj = cJSON_CreateObject();
return(jprint(txobj,1));