From 685f8240f09ae7185abb7dae44e5b96aa7d0c110 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 9 Dec 2017 20:39:30 +0400 Subject: [PATCH] Test --- iguana/exchanges/LP_commands.c | 4 +++- iguana/exchanges/LP_nativeDEX.c | 7 ++++--- iguana/exchanges/LP_privkey.c | 6 +----- 3 files changed, 8 insertions(+), 9 deletions(-) diff --git a/iguana/exchanges/LP_commands.c b/iguana/exchanges/LP_commands.c index dd87341eb..9c4b4fa2f 100644 --- a/iguana/exchanges/LP_commands.c +++ b/iguana/exchanges/LP_commands.c @@ -184,7 +184,7 @@ instantdex_claim()\n\ jdelete(argjson,"userpass"); if ( strcmp(method,"passphrase") == 0 ) { - char coinaddr[64]; + char coinaddr[64]; bits256 zero; G.USERPASS_COUNTER = 1; if ( LP_passphrase_init(jstr(argjson,"passphrase"),jstr(argjson,"gui")) < 0 ) return(clonestr("{\"error\":\"couldnt change passphrase\"}")); @@ -195,6 +195,8 @@ instantdex_claim()\n\ jaddbits256(retjson,"mypubkey",G.LP_mypub25519); bitcoin_address(coinaddr,0,60,G.LP_myrmd160,20); jaddstr(retjson,"KMD",coinaddr); + memset(zero.bytes,0,sizeof(zero)); + LP_instantdex_depositadd(coinaddr,zero); bitcoin_address(coinaddr,0,0,G.LP_myrmd160,20); jaddstr(retjson,"BTC",coinaddr); jaddstr(retjson,"NXT",G.LP_NXTaddr); diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index c30d15ab9..214f953dc 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -17,21 +17,22 @@ // LP_nativeDEX.c // marketmaker // +// ordermatch pricing error // signals -> autoprice // passphrase for deposits // https://github.com/bitcoin/bips/blob/master/bip-0143.mediawiki for signing BCH/BTG -// // compress packets // portfolio to set prices from historical // portfolio value based on ask? -// // else claim path +// +// WONTFIX: // dPoW security -> 4: KMD notarized, 5: BTC notarized, after next notary elections // bigendian architectures need to use little endian for sighash calcs // improve critical section detection when parallel trades // use electrum in case of addr change in swap // locktime claiming on sporadic assetchains -// there is an issue about waiting for notarization for a swap that never starts +// there is an issue about waiting for notarization for a swap that never starts (expiration ok) #include diff --git a/iguana/exchanges/LP_privkey.c b/iguana/exchanges/LP_privkey.c index 7f519adfd..baca4e6e4 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; char coinaddr[64]; bits256 zero; int32_t counter; //iambob,; struct LP_utxoinfo *utxo,*tmp; + static void *ctx; int32_t counter; //iambob,; struct LP_utxoinfo *utxo,*tmp; if ( ctx == 0 ) ctx = bitcoin_ctx(); if ( G.LP_pendingswaps != 0 ) @@ -328,10 +328,6 @@ 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)); - printf("passphrase init: call depositadd.(%s)\n",coinaddr); - LP_instantdex_depositadd(coinaddr,zero); return(0); }