diff --git a/iguana/exchanges/LP_bitcoin.c b/iguana/exchanges/LP_bitcoin.c index 57eac94e4..931931ad0 100644 --- a/iguana/exchanges/LP_bitcoin.c +++ b/iguana/exchanges/LP_bitcoin.c @@ -2150,16 +2150,17 @@ int32_t bitcoin_wif2priv(uint8_t wiftaddr,uint8_t *addrtypep,bits256 *privkeyp,c printf("wif %s -> buf too short len.%d\n",wifstr,len); return(-1); } + ptr = buf; if ( len < 38 ) { - memset(pbuf,0,sizeof(pbuf)); + /*memset(pbuf,0,sizeof(pbuf)); memcpy(pbuf+(38-len),buf,len); ptr = pbuf; int32_t i; for (i=0; i<38; i++) printf("%02x ",pbuf[i]); printf("pbuf from %d\n",len); - len += (38-len); - } else ptr = buf; + len += (38-len);*/ + } hash = bits256_doublesha256(0,ptr,len - 4); *addrtypep = (wiftaddr == 0) ? *ptr : ptr[1]; if ( (ptr[len - 4]&0xff) == hash.bytes[31] && (ptr[len - 3]&0xff) == hash.bytes[30] &&(ptr[len - 2]&0xff) == hash.bytes[29] && (ptr[len - 1]&0xff) == hash.bytes[28] ) @@ -2173,7 +2174,7 @@ int32_t bitcoin_wif2priv(uint8_t wiftaddr,uint8_t *addrtypep,bits256 *privkeyp,c else { int32_t i; for (i=0; i