From 04ea765934349455177a5ff83c4374a0440e386a Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 18 Dec 2017 23:54:00 +0700 Subject: [PATCH] Test --- iguana/exchanges/LP_privkey.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_privkey.c b/iguana/exchanges/LP_privkey.c index a40867afe..a7755661d 100644 --- a/iguana/exchanges/LP_privkey.c +++ b/iguana/exchanges/LP_privkey.c @@ -231,6 +231,7 @@ bits256 LP_privkeycalc(void *ctx,uint8_t *pubkey33,bits256 *pubkeyp,struct iguan { calc_NXTaddr(G.LP_NXTaddr,userpub.bytes,(uint8_t *)passphrase,(int32_t)strlen(passphrase)); conv_NXTpassword(privkey.bytes,pubkeyp->bytes,(uint8_t *)passphrase,(int32_t)strlen(passphrase)); + privkey.bytes[0] &= 248, privkey.bytes[31] &= 127, privkey.bytes[31] |= 64; //vcalc_sha256(0,checkkey.bytes,(uint8_t *)passphrase,(int32_t)strlen(passphrase)); //printf("SHA256.(%s) ",bits256_str(pstr,checkkey)); //printf("privkey.(%s)\n",bits256_str(pstr,privkey)); @@ -238,10 +239,13 @@ bits256 LP_privkeycalc(void *ctx,uint8_t *pubkey33,bits256 *pubkeyp,struct iguan else { bitcoin_wif2priv(coin->wiftaddr,&tmptype,&privkey,wifstr); + privkey.bytes[0] &= 248, privkey.bytes[31] &= 127, privkey.bytes[31] |= 64; + bitcoin_priv2wif(coin->wiftaddr,tmpstr,privkey,coin->wiftype); + if ( strcmp(tmpstr,wifstr) != 0 ) + printf("converted %s != %s\n",tmpstr,wifstr); nxtaddr = conv_NXTpassword(privkey.bytes,pubkeyp->bytes,0,0); RS_encode(G.LP_NXTaddr,nxtaddr); } - privkey.bytes[0] &= 248, privkey.bytes[31] &= 127, privkey.bytes[31] |= 64; bitcoin_priv2pub(ctx,coin->pubkey33,coin->smartaddr,privkey,coin->taddr,coin->pubtype); if ( coin->counter == 0 ) {