From 32ac1fe98012c81462e064df86095735a7827a6b Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 6 Jun 2017 19:52:46 +0300 Subject: [PATCH] Test --- iguana/exchanges/LP_include.h | 2 +- iguana/exchanges/LP_utxos.c | 6 ++---- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/iguana/exchanges/LP_include.h b/iguana/exchanges/LP_include.h index 73c57e2fc..0e9e37d89 100644 --- a/iguana/exchanges/LP_include.h +++ b/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]; }; diff --git a/iguana/exchanges/LP_utxos.c b/iguana/exchanges/LP_utxos.c index 6fd04fe4c..d921c84c7 100644 --- a/iguana/exchanges/LP_utxos.c +++ b/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));