Browse Source

test

release/v0.1
jl777 8 years ago
parent
commit
f6d70138c5
  1. 19
      iguana/iguana_chains.c

19
iguana/iguana_chains.c

@ -370,14 +370,17 @@ void iguana_chainparms(struct iguana_chain *chain,cJSON *argjson)
chain->pubtype = juint(argjson,"pubval");
chain->p2shtype = juint(argjson,"p2shval");
chain->wiftype = juint(argjson,"wifval");
/*if ( (hexstr= jstr(argjson,"pubval")) != 0 && strlen(hexstr) == 2 )
decode_hex((uint8_t *)&chain->pubtype,1,hexstr);
if ( (hexstr= jstr(argjson,"scriptval")) != 0 && strlen(hexstr) == 2 )
decode_hex((uint8_t *)&chain->p2shtype,1,hexstr);
else if ( (hexstr= jstr(argjson,"p2shval")) != 0 && strlen(hexstr) == 2 )
decode_hex((uint8_t *)&chain->p2shtype,1,hexstr);
if ( (hexstr= jstr(argjson,"wifval")) != 0 && strlen(hexstr) == 2 )
decode_hex((uint8_t *)&chain->wiftype,1,hexstr);*/
if ( chain->pubtype == 0 && chain->p2shtype == 0 && chain->wiftype == 0 )
{
if ( (hexstr= jstr(argjson,"pubval")) != 0 && strlen(hexstr) == 2 )
decode_hex((uint8_t *)&chain->pubtype,1,hexstr);
if ( (hexstr= jstr(argjson,"scriptval")) != 0 && strlen(hexstr) == 2 )
decode_hex((uint8_t *)&chain->p2shtype,1,hexstr);
else if ( (hexstr= jstr(argjson,"p2shval")) != 0 && strlen(hexstr) == 2 )
decode_hex((uint8_t *)&chain->p2shtype,1,hexstr);
if ( (hexstr= jstr(argjson,"wifval")) != 0 && strlen(hexstr) == 2 )
decode_hex((uint8_t *)&chain->wiftype,1,hexstr);
}
printf("addrtypes.(%02x %02x %02x) (%d %d %d)\n",chain->pubtype,chain->p2shtype,chain->wiftype,chain->pubtype,chain->p2shtype,chain->wiftype);
if ( (hexstr= jstr(argjson,"netmagic")) != 0 && strlen(hexstr) == 8 )
decode_hex((uint8_t *)chain->netmagic,4,hexstr);

Loading…
Cancel
Save