jl777 7 years ago
parent
commit
02ffefac7f
  1. 4
      iguana/exchanges/LP_nativeDEX.c
  2. 14
      iguana/exchanges/LP_prices.c
  3. 4
      iguana/exchanges/LP_socket.c

4
iguana/exchanges/LP_nativeDEX.c

@ -430,14 +430,14 @@ int32_t LP_mainloop_iter(void *ctx,char *myipaddr,struct LP_peerinfo *mypeer,int
//printf("%s ref.%d scan.%d to %d, longest.%d\n",coin->symbol,coin->firstrefht,coin->firstscanht,coin->lastscanht,coin->longestchain);
if ( coin->inactive != 0 )
continue;
if ( time(NULL) > coin->lastmonitor+60 )
if ( time(NULL) > coin->lastmonitor+600 )
{
//portable_mutex_lock(&coin->addrmutex);
HASH_ITER(hh,coin->addresses,ap,atmp)
{
if ( coin->electrum == 0 )
{
// issue listunspent
LP_listunspent_issue(coin->symbol,ap->coinaddr);
DL_FOREACH_SAFE(ap->utxos,up,utmp)
{
if ( up->spendheight <= 0 )

14
iguana/exchanges/LP_prices.c

@ -549,12 +549,6 @@ cJSON *LP_orderbookjson(char *symbol,struct LP_orderbookentry *op)
return(item);
}
void LP_check_unspents(char *symbol,struct LP_orderbookentry *op)
{
if ( op->numutxos == 0 )
LP_listunspent_issue(symbol,op->coinaddr);
}
struct LP_orderbookentry *LP_orderbookentry(char *address,char *base,char *rel,double price,int32_t numutxos,uint64_t basesatoshis,uint64_t maxsatoshis,bits256 pubkey,uint32_t timestamp)
{
struct LP_orderbookentry *op;
@ -698,10 +692,10 @@ char *LP_orderbook(char *base,char *rel,int32_t duration)
free(asks[i]);
asks[i] = 0;
}
if ( basecoin->lastmonitor > 60 )
basecoin->lastmonitor -= 60;
if ( relcoin->lastmonitor > 60 )
relcoin->lastmonitor -= 60;
if ( basecoin->lastmonitor > 3600 )
basecoin->lastmonitor -= 3600;
if ( relcoin->lastmonitor > 3600 )
relcoin->lastmonitor -= 3600;
jadd(retjson,"asks",array);
jaddnum(retjson,"numasks",numasks);
jaddstr(retjson,"base",base);

4
iguana/exchanges/LP_socket.c

@ -324,7 +324,7 @@ int32_t electrum_process_array(struct iguana_info *coin,char *coinaddr,cJSON *ar
if (tx->height <= 0 )
{
tx->height = jint(item,"height");
printf("%s %s >>>>>>>>>> set %s <- height %d\n",coin->symbol,coinaddr,bits256_str(str,txid),tx->height);
//printf("%s %s >>>>>>>>>> set %s <- height %d\n",coin->symbol,coinaddr,bits256_str(str,txid),tx->height);
}
value = j64bits(item,"value");
v = jint(item,"tx_pos");
@ -468,7 +468,7 @@ cJSON *electrum_address_listunspent(char *symbol,struct electrum_info *ep,cJSON
{
if ( (retjson= electrum_strarg(symbol,ep,retjsonp,"blockchain.address.listunspent",addr,ELECTRUM_TIMEOUT)) != 0 )
{
printf("%s %s LISTUNSPENT.(%s)\n",symbol,addr,jprint(retjson,0));
//printf("%s %s LISTUNSPENT.(%s)\n",symbol,addr,jprint(retjson,0));
if ( electrum_process_array(coin,addr,retjson) != 0 )
LP_postutxos(coin->symbol);
safecopy(coin->lastunspent,addr,sizeof(coin->lastunspent));

Loading…
Cancel
Save