diff --git a/iguana/exchanges/LP_instantdex.c b/iguana/exchanges/LP_instantdex.c index 978e2de51..db7196ab6 100644 --- a/iguana/exchanges/LP_instantdex.c +++ b/iguana/exchanges/LP_instantdex.c @@ -84,6 +84,29 @@ void LP_instantdex_filescreate(char *coinaddr) { char fname[512]; FILE *fp; bits256 txid; int32_t i,n; cJSON *array,*newarray,*txobj; sprintf(fname,"%s/deposits.%s",GLOBAL_DBDIR,coinaddr), OS_compatible_path(fname); + if ( (fp= fopen(fname,"rb")) == 0 ) + { + if ( (fp= fopen(fname,"wb+")) != 0 ) + { + for (i=0; i<2; i++) + { + if ( (array= LP_instantdex_txids(i,coinaddr)) != 0 ) + { + if ( (n= cJSON_GetArraySize(array)) > 0 ) + { + for (j=0; j