Browse Source

Test

etomic
jl777 7 years ago
parent
commit
913d75219b
  1. 1
      iguana/exchanges/LP_etomic.c
  2. 6
      iguana/exchanges/LP_privkey.c

1
iguana/exchanges/LP_etomic.c

@ -78,6 +78,7 @@ int32_t LP_etomic_priv2pub(uint8_t *pub64,bits256 privkey)
bits256_str(str,privkey); bits256_str(str,privkey);
if ( (pubstr= getPubKeyFromPriv(str)) != 0 ) if ( (pubstr= getPubKeyFromPriv(str)) != 0 )
{ {
printf("priv2pub got %s\n",pubstr);
if ( strlen(pubstr) == 128 && pubstr[0] == '0' && pubstr[1] == 'x' ) if ( strlen(pubstr) == 128 && pubstr[0] == '0' && pubstr[1] == 'x' )
{ {
decode_hex(pub33,64,pubstr+2); decode_hex(pub33,64,pubstr+2);

6
iguana/exchanges/LP_privkey.c

@ -295,16 +295,16 @@ 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); bitcoin_priv2pub(ctx,coin->symbol,coin->pubkey33,coin->smartaddr,privkey,coin->taddr,coin->pubtype);
{ {
uint8_t check33[33]; char checkaddr[64]; uint8_t check64[64]; char checkaddr[64];
if ( LP_etomic_priv2pub(check33,privkey) > 0 ) if ( LP_etomic_priv2pub(check33,privkey) > 0 )
{ {
if ( memcmp(check33,coin->pubkey33,33) == 0 ) if ( memcmp(check64,coin->pubkey33+1,32) == 0 )
{ {
printf("pubkey33 matches!\n"); printf("pubkey33 matches!\n");
if ( LP_etomic_pub2addr(checkaddr,check33) > 0 ) if ( LP_etomic_pub2addr(checkaddr,check33) > 0 )
printf("addr is (%s)\n",checkaddr); printf("addr is (%s)\n",checkaddr);
else printf("error getting addr\n"); else printf("error getting addr\n");
} else printf("pubkey 33 mismatch\n"); } else printf("pubkey 64 mismatch\n");
} else printf("error creating pubkey\n"); } else printf("error creating pubkey\n");
} }
if ( coin->counter == 0 ) if ( coin->counter == 0 )

Loading…
Cancel
Save