Browse Source

Test

etomic
jl777 7 years ago
parent
commit
eccfc47b6b
  1. 11
      iguana/exchanges/LP_instantdex.c
  2. 5
      iguana/exchanges/LP_nativeDEX.c

11
iguana/exchanges/LP_instantdex.c

@ -95,11 +95,10 @@ void LP_instantdex_filescreate()
}
}
void LP_instantdex_depositadd(bits256 txid)
{
static FILE *depositsfp;
char fname[512],coinaddr[64]; cJSON *array,*txobj; int32_t i,n,iter;
char fname[512],coinaddr[64]; bits256 prevtxid; cJSON *array,*txobj; int32_t i,n,iter;
if ( depositsfp == 0 )
{
sprintf(fname,"%s/deposits",GLOBAL_DBDIR), OS_compatible_path(fname);
@ -115,11 +114,11 @@ void LP_instantdex_depositadd(bits256 txid)
{
for (i=0; i<n; i++)
{
txid = jbits256i(array,i);
if ( (txobj= LP_gettxout("KMD",coinaddr,txid,2)) != 0 )
prevtxid = jbits256i(array,i);
if ( (txobj= LP_gettxout("KMD",coinaddr,prevtxid,2)) != 0 )
free_json(txobj);
else continue;
LP_instantdex_deposituniq(depositsfp,txid);
LP_instantdex_deposituniq(depositsfp,prevtxid);
}
}
free_json(array);
@ -127,7 +126,7 @@ void LP_instantdex_depositadd(bits256 txid)
}
} else fseek(depositsfp,0,SEEK_END);
}
if ( depositsfp != 0 )
if ( depositsfp != 0 && bits256_nonz(txid) != 0 )
{
LP_instantdex_deposituniq(depositsfp,txid);
fflush(depositsfp);

5
iguana/exchanges/LP_nativeDEX.c

@ -695,7 +695,7 @@ int32_t LP_mainloop_iter(void *ctx,char *myipaddr,struct LP_peerinfo *mypeer,int
void LP_initcoins(void *ctx,int32_t pubsock,cJSON *coins)
{
int32_t i,n,notarized; cJSON *item; char *symbol; struct iguana_info *coin;
int32_t i,n,notarized; bits256 zero; cJSON *item; char *symbol; struct iguana_info *coin;
for (i=0; i<sizeof(activecoins)/sizeof(*activecoins); i++)
{
printf("%s ",activecoins[i]);
@ -714,7 +714,8 @@ void LP_initcoins(void *ctx,int32_t pubsock,cJSON *coins)
if ( strcmp(coin->symbol,"KMD") == 0 )
{
LP_importaddress("KMD",BOTS_BONDADDRESS);
LP_instantdex_filescreate();
memset(zero.bytes,0,sizeof(zero));
LP_instantdex_depositadd(zero);
}
}
if ( coin->txfee == 0 && strcmp(coin->symbol,"BTC") != 0 )

Loading…
Cancel
Save