From 00666b9ec0e5dd5b09d75adc27d0640aeb74b7a1 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 6 Jun 2017 18:24:49 +0300 Subject: [PATCH] Test --- iguana/exchanges/LP_include.h | 2 +- iguana/exchanges/LP_nativeDEX.c | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/iguana/exchanges/LP_include.h b/iguana/exchanges/LP_include.h index 15cf24c31..73c57e2fc 100644 --- a/iguana/exchanges/LP_include.h +++ b/iguana/exchanges/LP_include.h @@ -171,7 +171,7 @@ struct LP_utxoinfo uint8_t key[sizeof(bits256) + sizeof(int32_t)]; uint8_t key2[sizeof(bits256) + sizeof(int32_t)]; int32_t vout,vout2,pair; - uint32_t lasttime,errors,swappending,published,spentflag; + uint32_t lasttime,errors,swappending,published,spentflag,lastspentcheck; double profitmargin; char ipaddr[64],coinaddr[64],spendscript[256],coin[16]; uint16_t port; diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index da601e7e0..58c952f0b 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -165,9 +165,10 @@ void LP_mainloop(struct LP_peerinfo *mypeer,uint16_t mypubport,int32_t pubsock,i char str[65]; HASH_ITER(hh,LP_utxoinfos,utxo,utmp) { - if ( utxo->spentflag == 0 ) + now = (uint32_t)time(NULL); + if ( utxo->spentflag == 0 && now > utxo->lastspentcheck+60 ) { - printf("mainloop check spent\n"); + utxo->lastspentcheck = now; if ( LP_txvalue(utxo->coin,utxo->txid,utxo->vout) == 0 ) { printf("txid.%s %s/v%d %.8f has been spent\n",utxo->coin,bits256_str(str,utxo->txid),utxo->vout,dstr(utxo->value));