Browse Source

Test

etomic
jl777 7 years ago
parent
commit
af3f152c71
  1. 1
      iguana/exchanges/LP_include.h
  2. 8
      iguana/exchanges/LP_utxos.c

1
iguana/exchanges/LP_include.h

@ -263,6 +263,7 @@ struct iguana_info
void *electrum; void *ctx;
uint64_t maxamount,kmd_equiv,balanceA,balanceB,valuesumA,valuesumB;
uint8_t pubkey33[33],zcash;
bits256 lastprivkey; uint32_t lastprivkeytime;
bits256 cachedtxid; uint8_t *cachedtxiddata; int32_t cachedtxidlen;
bits256 cachedmerkle; int32_t cachedmerkleheight;
};

8
iguana/exchanges/LP_utxos.c

@ -502,11 +502,17 @@ int32_t LP_privkey_init(int32_t mypubsock,struct iguana_info *coin,bits256 mypri
//printf("coin not active\n");
return(0);
}
if ( bits256_cmp(myprivkey,coin->lastprivkey) == 0 && time(NULL) < coin->lastprivkeytime+60 )
return(0);
coin->lastprivkey = myprivkey;
coin->lastprivkeytime = (uint32_t)time(NULL);
printf("privkey init.(%s) %s\n",coin->symbol,coin->smartaddr);
if ( coin->inactive == 0 )
LP_listunspent_issue(coin->symbol,coin->smartaddr,0);
array = LP_listunspent(coin->symbol,coin->smartaddr);
printf("unspent array %ld\n",strlen(jprint(array,0)));
LP_address(coin,coin->smartaddr);
if ( coin->inactive == 0 && (array= LP_listunspent(coin->symbol,coin->smartaddr)) != 0 )
if ( array != 0 )
{
txfee = LP_txfeecalc(coin,0,0);
if ( is_cJSON_Array(array) != 0 && (n= cJSON_GetArraySize(array)) > 0 )

Loading…
Cancel
Save