Browse Source

Test

etomic
jl777 7 years ago
parent
commit
685f8240f0
  1. 4
      iguana/exchanges/LP_commands.c
  2. 7
      iguana/exchanges/LP_nativeDEX.c
  3. 6
      iguana/exchanges/LP_privkey.c

4
iguana/exchanges/LP_commands.c

@ -184,7 +184,7 @@ instantdex_claim()\n\
jdelete(argjson,"userpass"); jdelete(argjson,"userpass");
if ( strcmp(method,"passphrase") == 0 ) if ( strcmp(method,"passphrase") == 0 )
{ {
char coinaddr[64]; char coinaddr[64]; bits256 zero;
G.USERPASS_COUNTER = 1; G.USERPASS_COUNTER = 1;
if ( LP_passphrase_init(jstr(argjson,"passphrase"),jstr(argjson,"gui")) < 0 ) if ( LP_passphrase_init(jstr(argjson,"passphrase"),jstr(argjson,"gui")) < 0 )
return(clonestr("{\"error\":\"couldnt change passphrase\"}")); return(clonestr("{\"error\":\"couldnt change passphrase\"}"));
@ -195,6 +195,8 @@ instantdex_claim()\n\
jaddbits256(retjson,"mypubkey",G.LP_mypub25519); jaddbits256(retjson,"mypubkey",G.LP_mypub25519);
bitcoin_address(coinaddr,0,60,G.LP_myrmd160,20); bitcoin_address(coinaddr,0,60,G.LP_myrmd160,20);
jaddstr(retjson,"KMD",coinaddr); jaddstr(retjson,"KMD",coinaddr);
memset(zero.bytes,0,sizeof(zero));
LP_instantdex_depositadd(coinaddr,zero);
bitcoin_address(coinaddr,0,0,G.LP_myrmd160,20); bitcoin_address(coinaddr,0,0,G.LP_myrmd160,20);
jaddstr(retjson,"BTC",coinaddr); jaddstr(retjson,"BTC",coinaddr);
jaddstr(retjson,"NXT",G.LP_NXTaddr); jaddstr(retjson,"NXT",G.LP_NXTaddr);

7
iguana/exchanges/LP_nativeDEX.c

@ -17,21 +17,22 @@
// LP_nativeDEX.c // LP_nativeDEX.c
// marketmaker // marketmaker
// //
// ordermatch pricing error
// signals -> autoprice // signals -> autoprice
// passphrase for deposits // passphrase for deposits
// https://github.com/bitcoin/bips/blob/master/bip-0143.mediawiki for signing BCH/BTG // https://github.com/bitcoin/bips/blob/master/bip-0143.mediawiki for signing BCH/BTG
//
// compress packets // compress packets
// portfolio to set prices from historical // portfolio to set prices from historical
// portfolio value based on ask? // portfolio value based on ask?
//
// else claim path // else claim path
//
// WONTFIX:
// dPoW security -> 4: KMD notarized, 5: BTC notarized, after next notary elections // dPoW security -> 4: KMD notarized, 5: BTC notarized, after next notary elections
// bigendian architectures need to use little endian for sighash calcs // bigendian architectures need to use little endian for sighash calcs
// improve critical section detection when parallel trades // improve critical section detection when parallel trades
// use electrum in case of addr change in swap // use electrum in case of addr change in swap
// locktime claiming on sporadic assetchains // 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 <stdio.h> #include <stdio.h>

6
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) 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 ) if ( ctx == 0 )
ctx = bitcoin_ctx(); ctx = bitcoin_ctx();
if ( G.LP_pendingswaps != 0 ) 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)); safecopy(G.gui,gui,sizeof(G.gui));
G.USERPASS_COUNTER = counter; G.USERPASS_COUNTER = counter;
G.initializing = 0; 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); return(0);
} }

Loading…
Cancel
Save