Browse Source

Test

etomic
jl777 8 years ago
parent
commit
fe7ae767e0
  1. 7
      iguana/exchanges/LP_utxos.c
  2. 4
      iguana/main.c

7
iguana/exchanges/LP_utxos.c

@ -952,9 +952,14 @@ char *LP_secretaddresses(void *ctx,char *passphrase,int32_t n,uint8_t taddr,uint
bits256 LP_privkeycalc(void *ctx,uint8_t *pubkey33,bits256 *pubkeyp,struct iguana_info *coin,char *passphrase,char *wifstr) bits256 LP_privkeycalc(void *ctx,uint8_t *pubkey33,bits256 *pubkeyp,struct iguana_info *coin,char *passphrase,char *wifstr)
{ {
static uint32_t counter; static uint32_t counter;
bits256 privkey,userpub,userpass,checkkey; char tmpstr[128]; cJSON *retjson; uint8_t tmptype,rmd160[20]; bits256 privkey,userpub,userpass,checkkey; char tmpstr[128],pstr[65]; cJSON *retjson; uint8_t tmptype,rmd160[20];
if ( passphrase != 0 && passphrase[0] != 0 ) if ( passphrase != 0 && passphrase[0] != 0 )
{
conv_NXTpassword(privkey.bytes,pubkeyp->bytes,(uint8_t *)passphrase,(int32_t)strlen(passphrase)); conv_NXTpassword(privkey.bytes,pubkeyp->bytes,(uint8_t *)passphrase,(int32_t)strlen(passphrase));
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));
}
else else
{ {
bitcoin_wif2priv(coin->wiftaddr,&tmptype,&privkey,wifstr); bitcoin_wif2priv(coin->wiftaddr,&tmptype,&privkey,wifstr);

4
iguana/main.c

@ -887,7 +887,7 @@ uint8_t *SuperNET_ciphercalc(void **ptrp,int32_t *cipherlenp,bits256 *privkeyp,b
cJSON *SuperNET_rosettajson(struct supernet_info *myinfo,bits256 privkey,int32_t showprivs) cJSON *SuperNET_rosettajson(struct supernet_info *myinfo,bits256 privkey,int32_t showprivs)
{ {
uint8_t rmd160[20],pub[33]; uint64_t nxt64bits; bits256 pubkey; uint8_t rmd160[20],pub[33]; uint64_t nxt64bits; bits256 pubkey;
char str2[41],wifbuf[64],addr[64],str[128],coinwif[16]; cJSON *retjson; struct iguana_info *coin,*tmp; char str2[41],wifbuf[64],pbuf[65],addr[64],str[128],coinwif[16]; cJSON *retjson; struct iguana_info *coin,*tmp;
pubkey = acct777_pubkey(privkey); pubkey = acct777_pubkey(privkey);
nxt64bits = acct777_nxt64bits(pubkey); nxt64bits = acct777_nxt64bits(pubkey);
retjson = cJSON_CreateObject(); retjson = cJSON_CreateObject();
@ -900,6 +900,8 @@ cJSON *SuperNET_rosettajson(struct supernet_info *myinfo,bits256 privkey,int32_t
jaddstr(retjson,"btcpubkey",str); jaddstr(retjson,"btcpubkey",str);
calc_OP_HASH160(str2,rmd160,str); calc_OP_HASH160(str2,rmd160,str);
jaddstr(retjson,"rmd160",str2); jaddstr(retjson,"rmd160",str2);
if ( showprivs != 0 )
jaddstr(retjson,"privkey",bits256_str(pbuf,privkey));
HASH_ITER(hh,myinfo->allcoins,coin,tmp) HASH_ITER(hh,myinfo->allcoins,coin,tmp)
{ {
if ( coin != 0 && coin->symbol[0] != 0 ) if ( coin != 0 && coin->symbol[0] != 0 )

Loading…
Cancel
Save