diff --git a/iguana/exchanges/LP_bitcoin.c b/iguana/exchanges/LP_bitcoin.c index df457d009..83439dae3 100644 --- a/iguana/exchanges/LP_bitcoin.c +++ b/iguana/exchanges/LP_bitcoin.c @@ -2195,12 +2195,15 @@ int32_t bitcoin_wif2addr(void *ctx,uint8_t wiftaddr,uint8_t taddr,uint8_t pubtyp int32_t bitcoin_priv2wif(uint8_t wiftaddr,char *wifstr,bits256 privkey,uint8_t addrtype) { uint8_t data[128]; int32_t offset,len = 32; - memcpy(data+1,privkey.bytes,sizeof(privkey)); offset = 1 + (wiftaddr != 0); + memcpy(data+offset,privkey.bytes,sizeof(privkey)); data[offset + len++] = 1; len = base58encode_checkbuf(wiftaddr,addrtype,data,len); if ( bitcoin_base58encode(wifstr,data,len) == 0 ) + { + char str[65]; printf("error making wif from %s\n",bits256_str(str,privkey)); return(-1); + } if ( 1 ) { uint8_t checktype; bits256 checkpriv; char str[65],str2[65]; diff --git a/iguana/exchanges/LP_privkey.c b/iguana/exchanges/LP_privkey.c index 2b8334b05..d0d1e65d6 100644 --- a/iguana/exchanges/LP_privkey.c +++ b/iguana/exchanges/LP_privkey.c @@ -209,6 +209,8 @@ int32_t LP_wifstr_valid(char *wifstr) { bitcoin_wif2priv(0,&wiftype,&privkey,wifstr); bitcoin_priv2wif(0,cmpstr,privkey,wiftype); + char str[65]; printf("%s -> %s -> %s\n",wifstr,bits256_str(str,privkey),cmpstr); + return(1); if ( strcmp(cmpstr,wifstr) == 0 ) { //printf("%s is valid wif\n",wifstr);