Browse Source

Test

etomic
jl777 7 years ago
parent
commit
b53fde0c23
  1. 7
      iguana/exchanges/LP_nativeDEX.c
  2. 11
      iguana/exchanges/LP_tradebots.c

7
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

11
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;
}

Loading…
Cancel
Save