From b53fde0c239e1ea77459ec3889d299a2d9135d29 Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 10 Nov 2017 12:05:27 +0200 Subject: [PATCH] Test --- iguana/exchanges/LP_nativeDEX.c | 7 +++++-- iguana/exchanges/LP_tradebots.c | 11 +++++++---- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index b51741787..c8950c7c7 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -18,8 +18,11 @@ // LP_nativeDEX.c // marketmaker // -// bot status 1600% ? - +// swap started, pending, locked, finished, ... +// aliceid +//there is still a pending one with `-1 wait for bobpayment bYoNxkfvwQ42Yufry8J5y8BYi6mQxokvW9 numconfs.1 MNZ c0ea4aa808a653222a15122d96692fecf734dbbacfb9a54cb4711306ea0c3cef`, but that tx is already spent including 6 confirmation +// bot safe to exit? +// // BCH signing // dPoW security -> 4: KMD notarized, 5: BTC notarized, after next notary elections // bigendian architectures need to use little endian for sighash calcs diff --git a/iguana/exchanges/LP_tradebots.c b/iguana/exchanges/LP_tradebots.c index 02672eaca..424909766 100644 --- a/iguana/exchanges/LP_tradebots.c +++ b/iguana/exchanges/LP_tradebots.c @@ -18,8 +18,8 @@ // marketmaker // -#define TRADEBOTS_GAPTIME 60 -#define LP_TRADEBOTS_MAXTRADES 100 +#define TRADEBOTS_GAPTIME 120 +#define LP_TRADEBOTS_MAXTRADES 10 struct LP_tradebot_trade { @@ -36,7 +36,7 @@ struct LP_tradebot char name[128],base[32],rel[32]; int32_t numtrades,numpending,completed,dispdir; double maxprice,totalrelvolume,totalbasevolume,basesum,relsum,pendbasesum,pendrelsum; - uint32_t dead,pause,userpause,started,id; + uint32_t lasttime,dead,pause,userpause,started,id; struct LP_tradebot_trade *trades[LP_TRADEBOTS_MAXTRADES]; } *LP_tradebots; @@ -438,8 +438,11 @@ void LP_tradebots_timeslice(void *ctx) bot->pause = (uint32_t)time(NULL); else if ( bot->userpause == 0 ) bot->pause = 0; - if ( bot->numpending == 0 ) + if ( bot->numpending == 0 && time(NULL) > bot->lasttime+TRADEBOTS_GAPTIME ) + { LP_tradebot_timeslice(ctx,bot); + bot->lasttime = (uint32_t)time(NULL); + } } lastnumfinished = LP_numfinished; }