From f6d70138c5f3ba877271a17508c6599253ae292f Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 21 Aug 2016 23:41:05 -0300 Subject: [PATCH] test --- iguana/iguana_chains.c | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/iguana/iguana_chains.c b/iguana/iguana_chains.c index 2af8bd2ca..740f9c34d 100755 --- a/iguana/iguana_chains.c +++ b/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);