Browse Source

Test

etomic
jl777 8 years ago
parent
commit
32ac1fe980
  1. 2
      iguana/exchanges/LP_include.h
  2. 6
      iguana/exchanges/LP_utxos.c

2
iguana/exchanges/LP_include.h

@ -140,7 +140,7 @@ struct basilisk_swapinfo
struct iguana_info
{
uint64_t txfee; double estimatedrate;
int32_t longestchain;
int32_t longestchain; uint32_t counter;
uint8_t pubtype,p2shtype,isPoS,wiftype;
char symbol[16],smartaddr[64],userpass[1024],serverport[128];
};

6
iguana/exchanges/LP_utxos.c

@ -372,22 +372,20 @@ int32_t LP_nearestvalue(uint64_t *values,int32_t n,uint64_t targetval)
uint64_t LP_privkey_init(struct LP_peerinfo *mypeer,int32_t mypubsock,char *symbol,char *passphrase,char *wifstr,int32_t amclient)
{
static uint32_t counter;
char *script; struct LP_utxoinfo *utxo; cJSON *array,*item,*retjson; bits256 userpass,userpub,txid,deposittxid; int32_t used,i,n,vout,depositvout; uint64_t *values,satoshis,depositval,targetval,value,total = 0; bits256 privkey,pubkey; uint8_t pubkey33[33],tmptype,rmd160[20]; struct iguana_info *coin = LP_coinfind(symbol);
if ( coin == 0 )
{
printf("cant add privkey for %s, coin not active\n",symbol);
return(0);
}
printf("privkey.%s init\n",symbol);
if ( passphrase != 0 )
conv_NXTpassword(privkey.bytes,pubkey.bytes,(uint8_t *)passphrase,(int32_t)strlen(passphrase));
else privkey = iguana_wif2privkey(wifstr);
iguana_priv2pub(pubkey33,coin->smartaddr,privkey,coin->pubtype);
if ( counter == 0 )
if ( coin->counter == 0 )
{
char tmpstr[128];
counter++;
coin->counter++;
bitcoin_priv2wif(USERPASS_WIFSTR,privkey,188);
bitcoin_priv2wif(tmpstr,privkey,coin->wiftype);
conv_NXTpassword(userpass.bytes,pubkey.bytes,(uint8_t *)tmpstr,(int32_t)strlen(tmpstr));

Loading…
Cancel
Save