|
|
@ -566,7 +566,7 @@ char *bitcoin_json2hex(struct supernet_info *myinfo,struct iguana_info *coin,bit |
|
|
|
return(txbytes); |
|
|
|
} |
|
|
|
|
|
|
|
cJSON *bitcoin_data2json(struct iguana_info *coin,bits256 *txidp,struct iguana_msgtx *msgtx,uint8_t *extraspace,int32_t extralen,uint8_t *serialized,int32_t len) |
|
|
|
cJSON *bitcoin_data2json(struct iguana_info *coin,bits256 *txidp,struct iguana_msgtx *msgtx,uint8_t *extraspace,int32_t extralen,uint8_t *serialized,int32_t len,cJSON *vins) |
|
|
|
{ |
|
|
|
int32_t n; char vpnstr[64]; struct iguana_msgtx M; cJSON *txobj; |
|
|
|
if ( coin == 0 || serialized == 0 ) |
|
|
@ -577,7 +577,7 @@ cJSON *bitcoin_data2json(struct iguana_info *coin,bits256 *txidp,struct iguana_m |
|
|
|
memset(msgtx,0,sizeof(M)); |
|
|
|
vpnstr[0] = 0; |
|
|
|
memset(txidp,0,sizeof(*txidp)); |
|
|
|
if ( (n= iguana_rwmsgtx(coin,0,txobj,serialized,len,msgtx,txidp,vpnstr,extraspace,extralen,0)) <= 0 ) |
|
|
|
if ( (n= iguana_rwmsgtx(coin,0,txobj,serialized,len,msgtx,txidp,vpnstr,extraspace,extralen,vins)) <= 0 ) |
|
|
|
{ |
|
|
|
free_json(txobj); |
|
|
|
txobj = cJSON_CreateObject(); |
|
|
@ -587,7 +587,7 @@ cJSON *bitcoin_data2json(struct iguana_info *coin,bits256 *txidp,struct iguana_m |
|
|
|
return(txobj); |
|
|
|
} |
|
|
|
|
|
|
|
cJSON *bitcoin_hex2json(struct iguana_info *coin,bits256 *txidp,struct iguana_msgtx *msgtx,char *txbytes,uint8_t *extraspace,int32_t extralen,uint8_t *origserialized) |
|
|
|
cJSON *bitcoin_hex2json(struct iguana_info *coin,bits256 *txidp,struct iguana_msgtx *msgtx,char *txbytes,uint8_t *extraspace,int32_t extralen,uint8_t *origserialized,cJSON *vins) |
|
|
|
{ |
|
|
|
int32_t len; uint8_t *serialized; cJSON *txobj; |
|
|
|
if ( coin == 0 || txbytes == 0 ) |
|
|
@ -596,7 +596,7 @@ cJSON *bitcoin_hex2json(struct iguana_info *coin,bits256 *txidp,struct iguana_ms |
|
|
|
if ( (serialized= origserialized) == 0 ) |
|
|
|
serialized = calloc(1,len); |
|
|
|
decode_hex(serialized,len,txbytes); |
|
|
|
txobj = bitcoin_data2json(coin,txidp,msgtx,extraspace,extralen,serialized,len); |
|
|
|
txobj = bitcoin_data2json(coin,txidp,msgtx,extraspace,extralen,serialized,len,vins); |
|
|
|
if ( serialized != origserialized ) |
|
|
|
free(serialized); |
|
|
|
return(txobj); |
|
|
@ -1096,9 +1096,9 @@ int32_t iguana_signrawtransaction(struct supernet_info *myinfo,struct iguana_inf |
|
|
|
extraspace = malloc(extralen); |
|
|
|
memset(msgtx,0,sizeof(*msgtx)); |
|
|
|
decode_hex(serialized,len,rawtx); |
|
|
|
if ( (txobj= bitcoin_hex2json(coin,&txid,msgtx,rawtx,extraspace,extralen,serialized4)) != 0 ) |
|
|
|
if ( (txobj= bitcoin_hex2json(coin,&txid,msgtx,rawtx,extraspace,extralen,serialized4,vins)) != 0 ) |
|
|
|
{ |
|
|
|
//printf("txobj.(%s)\n",jprint(txobj,0));
|
|
|
|
printf("txobj.(%s)\n",jprint(txobj,0)); |
|
|
|
if ( (checkstr= bitcoin_json2hex(myinfo,coin,&txid,txobj,0)) != 0 ) |
|
|
|
{ |
|
|
|
if ( strcmp(rawtx,checkstr) != 0 ) |
|
|
|