From 4a89d15097c9ef2372fe311ff66dc8e8c9199e34 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 7 Feb 2018 11:23:32 +0200 Subject: [PATCH] Test --- iguana/exchanges/LP_etomic.c | 5 ++--- iguana/exchanges/LP_privkey.c | 7 +++---- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/iguana/exchanges/LP_etomic.c b/iguana/exchanges/LP_etomic.c index 48f3a12cc..5a0a87821 100644 --- a/iguana/exchanges/LP_etomic.c +++ b/iguana/exchanges/LP_etomic.c @@ -65,7 +65,6 @@ int32_t LP_etomic_priv2addr(char *coinaddr,bits256 privkey) bits256_str(str,privkey); if ( (addrstr= privKey2Addr(str)) != 0 ) { - printf("priv2addr got %s\n",addrstr); strcpy(coinaddr,addrstr); free(addrstr); return(0); @@ -82,7 +81,7 @@ int32_t LP_etomic_priv2pub(uint8_t *pub64,bits256 privkey) if ( strlen(pubstr) == 130 && pubstr[0] == '0' && pubstr[1] == 'x' ) { decode_hex(pub64,64,pubstr+2); - retval = 64; + retval = 0; } free(pubstr); } @@ -98,7 +97,7 @@ int32_t LP_etomic_pub2addr(char *coinaddr,uint8_t pub64[64]) { strcpy(coinaddr,addrstr); free(addrstr); - return((int32_t)strlen(coinaddr)); + return(0); } return(-1); } diff --git a/iguana/exchanges/LP_privkey.c b/iguana/exchanges/LP_privkey.c index c9c08f1e8..35aa506ac 100644 --- a/iguana/exchanges/LP_privkey.c +++ b/iguana/exchanges/LP_privkey.c @@ -296,15 +296,14 @@ bits256 LP_privkeycalc(void *ctx,uint8_t *pubkey33,bits256 *pubkeyp,struct iguan bitcoin_priv2pub(ctx,coin->symbol,coin->pubkey33,coin->smartaddr,privkey,coin->taddr,coin->pubtype); { uint8_t check64[64]; char checkaddr[64],checkaddr2[64]; - if ( LP_etomic_priv2pub(check64,privkey) > 0 ) + if ( LP_etomic_priv2pub(check64,privkey) == 0 ) { if ( memcmp(check64,coin->pubkey33+1,32) == 0 ) { - if ( LP_etomic_priv2addr(checkaddr2,privkey) > 0 && LP_etomic_pub2addr(checkaddr,check64) > 0 && strcmp(checkaddr2,checkaddr) == 0 ) + if ( LP_etomic_priv2addr(checkaddr,privkey) == 0 && LP_etomic_pub2addr(checkaddr2,check64) == 0 && strcmp(checkaddr,checkaddr2) == 0 ) { printf("addr is (%s)\n",checkaddr); - } - else printf("error getting addr\n"); + } else printf("error getting addr (%s) != (%s)\n",checkaddr,checkaddr2); } else printf("pubkey 64 mismatch\n"); } else printf("error creating pubkey\n"); }