From ab3d29a39cc0de0e868e51121bd1620c7f0b883e Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 24 Jan 2018 12:58:52 +0400 Subject: [PATCH] Test --- iguana/exchanges/LP_bitcoin.c | 2 +- iguana/exchanges/LP_privkey.c | 11 +++++++---- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/iguana/exchanges/LP_bitcoin.c b/iguana/exchanges/LP_bitcoin.c index 2c141bb70..b26d2c0fa 100644 --- a/iguana/exchanges/LP_bitcoin.c +++ b/iguana/exchanges/LP_bitcoin.c @@ -2286,7 +2286,7 @@ int32_t bitcoin_priv2wif(char *symbol,uint8_t wiftaddr,char *wifstr,bits256 priv char str[65]; printf("error making wif from %s\n",bits256_str(str,privkey)); return(-1); } - if ( 1 ) + if ( 0 ) { uint8_t checktype; bits256 checkpriv; char str[65],str2[65]; if ( bitcoin_wif2priv(symbol,wiftaddr,&checktype,&checkpriv,wifstr) == sizeof(bits256) ) diff --git a/iguana/exchanges/LP_privkey.c b/iguana/exchanges/LP_privkey.c index 8465045b1..c86edfde9 100644 --- a/iguana/exchanges/LP_privkey.c +++ b/iguana/exchanges/LP_privkey.c @@ -278,13 +278,16 @@ bits256 LP_privkeycalc(void *ctx,uint8_t *pubkey33,bits256 *pubkeyp,struct iguan } else { - bitcoin_wif2priv(coin->symbol,0,&tmptype,&privkey,wifstr); + bitcoin_wif2priv(coin->symbol,coin->wiftaddr,&tmptype,&privkey,wifstr); bitcoin_priv2wif(coin->symbol,coin->wiftaddr,tmpstr,privkey,tmptype); if ( strcmp(tmpstr,wifstr) != 0 ) { - bitcoin_wif2priv(coin->symbol,coin->wiftaddr,&tmptype,&privkey,tmpstr); - char str[65]; printf("%s error reproducing the wifstr, likely edge case like non-supported uncompressed pubkey privkey.%s\n",coin->symbol,bits256_str(str,privkey)); - exit(1); + bitcoin_wif2priv(coin->symbol,coin->wiftaddr,&tmptype,&tmpkey,tmpstr); + if ( bits256_cmp(tmpkey,privkey) != 0 ) + { + char str[65]; printf("%s error reproducing the wifstr, likely edge case like non-supported uncompressed pubkey privkey.%s\n",coin->symbol,bits256_str(str,privkey)); + exit(1); + } } tmpkey = privkey; nxtaddr = conv_NXTpassword(tmpkey.bytes,pubkeyp->bytes,0,0);