From ee0596108c75ef286c60a495e47b73d527eab959 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 7 Dec 2017 13:39:15 +0400 Subject: [PATCH] Test --- iguana/exchanges/LP_instantdex.c | 16 +++++++--------- iguana/exchanges/LP_nativeDEX.c | 6 +----- iguana/exchanges/LP_privkey.c | 5 ++++- 3 files changed, 12 insertions(+), 15 deletions(-) diff --git a/iguana/exchanges/LP_instantdex.c b/iguana/exchanges/LP_instantdex.c index 8d4f97ce5..c8d2c08e3 100644 --- a/iguana/exchanges/LP_instantdex.c +++ b/iguana/exchanges/LP_instantdex.c @@ -71,17 +71,16 @@ void LP_instantdex_deposituniq(FILE *fp,bits256 txid) } else fseek(fp,n * sizeof(txid),SEEK_SET); } -void LP_instantdex_filescreate() +void LP_instantdex_filescreate(char *coinaddr) { - char fname[512]; FILE *fp; char coinaddr[64]; bits256 txid; int32_t i,n; cJSON *array,*newarray,*txobj; - sprintf(fname,"%s/deposits",GLOBAL_DBDIR), OS_compatible_path(fname); + 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 ) { array = cJSON_CreateArray(); newarray = cJSON_CreateArray(); fseek(fp,0,SEEK_END); n = (int32_t)(ftell(fp) / sizeof(txid)); - bitcoin_address(coinaddr,0,60,G.LP_myrmd160,20); for (i=0; isymbol,coin->smartaddr); if ( strcmp(coin->symbol,"KMD") == 0 ) - { LP_importaddress("KMD",BOTS_BONDADDRESS); - memset(zero.bytes,0,sizeof(zero)); - LP_instantdex_depositadd(zero); - } } if ( coin->txfee == 0 && strcmp(coin->symbol,"BTC") != 0 ) coin->txfee = LP_MIN_TXFEE; diff --git a/iguana/exchanges/LP_privkey.c b/iguana/exchanges/LP_privkey.c index 5c77b4c89..0d5a515dd 100644 --- a/iguana/exchanges/LP_privkey.c +++ b/iguana/exchanges/LP_privkey.c @@ -307,7 +307,7 @@ void LP_privkey_updates(void *ctx,int32_t pubsock,char *passphrase) int32_t LP_passphrase_init(char *passphrase,char *gui) { - static void *ctx; int32_t counter; //iambob,; struct LP_utxoinfo *utxo,*tmp; + static void *ctx; char coinaddr[64]; bits256 zero; int32_t counter; //iambob,; struct LP_utxoinfo *utxo,*tmp; if ( ctx == 0 ) ctx = bitcoin_ctx(); if ( G.LP_pendingswaps != 0 ) @@ -348,6 +348,9 @@ int32_t LP_passphrase_init(char *passphrase,char *gui) safecopy(G.gui,gui,sizeof(G.gui)); G.USERPASS_COUNTER = counter; G.initializing = 0; + bitcoin_address(coinaddr,0,60,G.LP_myrmd160,20); + memset(zero.bytes,0,sizeof(zero)); + LP_instantdex_depositadd(coinaddr,zero); return(0); }