jl777 7 years ago
parent
commit
681e127914
  1. 3
      iguana/exchanges/LP_instantdex.c
  2. 7
      iguana/exchanges/LP_nativeDEX.c

3
iguana/exchanges/LP_instantdex.c

@ -88,6 +88,7 @@ void LP_instantdex_filescreate(char *coinaddr)
{ {
if ( (fp= fopen(fname,"wb+")) != 0 ) if ( (fp= fopen(fname,"wb+")) != 0 )
{ {
printf("created %s\n");
for (i=0; i<2; i++) for (i=0; i<2; i++)
{ {
if ( (array= LP_instantdex_txids(i,coinaddr)) != 0 ) if ( (array= LP_instantdex_txids(i,coinaddr)) != 0 )
@ -97,10 +98,12 @@ void LP_instantdex_filescreate(char *coinaddr)
for (j=0; j<n; j++) for (j=0; j<n; j++)
{ {
txid = jbits256i(array,j); txid = jbits256i(array,j);
printf("j.%d of %d: %s\n",j,n,bits256_str(str,txid));
LP_instantdex_deposituniq(fp,txid); LP_instantdex_deposituniq(fp,txid);
fflush(fp); fflush(fp);
} }
} }
printf("i.%d n.%d\n",i,n);
free_json(array); free_json(array);
} }
} }

7
iguana/exchanges/LP_nativeDEX.c

@ -512,6 +512,7 @@ void command_rpcloop(void *ctx)
void LP_coinsloop(void *_coins) void LP_coinsloop(void *_coins)
{ {
static int32_t didfilescreate;
struct LP_address *ap=0; struct LP_transaction *tx; cJSON *retjson; struct LP_address_utxo *up,*tmp; struct iguana_info *coin,*ctmp; char str[65]; struct electrum_info *ep,*backupep=0; bits256 zero; int32_t notarized,oldht,j,nonz; char *coins = _coins; struct LP_address *ap=0; struct LP_transaction *tx; cJSON *retjson; struct LP_address_utxo *up,*tmp; struct iguana_info *coin,*ctmp; char str[65]; struct electrum_info *ep,*backupep=0; bits256 zero; int32_t notarized,oldht,j,nonz; char *coins = _coins;
if ( strcmp("BTC",coins) == 0 ) if ( strcmp("BTC",coins) == 0 )
{ {
@ -561,6 +562,11 @@ void LP_coinsloop(void *_coins)
//printf("%s has no smartaddress??\n",coin->symbol); //printf("%s has no smartaddress??\n",coin->symbol);
continue; continue;
} }
if ( didfilescreate == 0 && strcmp("KMD",coin->symbol) == 0 )
{
LP_instantdex_filescreate(coin->smartaddr);
didfilescreate = 1;
}
memset(&zero,0,sizeof(zero)); memset(&zero,0,sizeof(zero));
if ( coin->inactive != 0 ) if ( coin->inactive != 0 )
continue; continue;
@ -818,7 +824,6 @@ void LP_initcoins(void *ctx,int32_t pubsock,cJSON *coins)
{ {
LP_importaddress("KMD",BOTS_BONDADDRESS); LP_importaddress("KMD",BOTS_BONDADDRESS);
LP_dPoW_request(coin); LP_dPoW_request(coin);
LP_instantdex_filescreate(coin->smartaddr);
} }
} }
if ( coin->txfee == 0 && strcmp(coin->symbol,"BTC") != 0 ) if ( coin->txfee == 0 && strcmp(coin->symbol,"BTC") != 0 )

Loading…
Cancel
Save