From c778ed10be8c9d9f492faf5bea58e95250d0fe57 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 28 Nov 2017 17:10:31 +0400 Subject: [PATCH] Test --- iguana/exchanges/LP_instantdex.c | 4 ++-- iguana/exchanges/LP_nativeDEX.c | 2 -- iguana/exchanges/LP_ordermatch.c | 2 ++ 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/iguana/exchanges/LP_instantdex.c b/iguana/exchanges/LP_instantdex.c index 6cd643c0f..616376a3b 100644 --- a/iguana/exchanges/LP_instantdex.c +++ b/iguana/exchanges/LP_instantdex.c @@ -297,7 +297,7 @@ int64_t LP_instantdex_creditcalc(struct iguana_info *coin,int32_t dispflag,bits2 void LP_instantdex_proofcheck(char *coinaddr,cJSON *proof,int32_t num) { uint8_t rmd160[20],addrtype; int32_t i; char othersmartaddr[64]; struct iguana_info *coin; struct LP_address *ap = 0; - if ( (coin= LP_coinfind("KMD")) != 0 && coin->electrum != 0 ) + if ( (coin= LP_coinfind("KMD")) != 0 ) { bitcoin_addr2rmd160(0,&addrtype,rmd160,coinaddr); bitcoin_address(othersmartaddr,0,60,rmd160,20); @@ -308,7 +308,7 @@ void LP_instantdex_proofcheck(char *coinaddr,cJSON *proof,int32_t num) LP_instantdex_creditcalc(coin,1,jbits256i(proof,i),othersmartaddr); ap->didinstantdex = 1; printf("validated instantdex %s.[%d] proof.(%s)\n",othersmartaddr,num,jprint(proof,0)); - } + } else printf("cant find ap.%p or already did %d %.8f\n",ap,ap!=0?ap->didinstantdex:-1,ap!=0?dstr(ap->instantdex_credits):-1); } } diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 91a6150d5..63c9e5705 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -17,9 +17,7 @@ // LP_nativeDEX.c // marketmaker // -// optimize electrum swap // big BTC swaps -// electrum dynamic trust over 1000 tx // https://github.com/bitcoin/bips/blob/master/bip-0143.mediawiki for signing BCH/BTG // // cancel bid/ask diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index 053e725bb..2643b7c2a 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -1195,6 +1195,7 @@ int32_t LP_tradecommand(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson, bestprice = LP_bob_competition(&counter,aliceid,qprice,1000); if ( bits256_cmp(G.LP_mypub25519,Q.desthash) == 0 && bits256_cmp(G.LP_mypub25519,Q.srchash) != 0 ) { + printf("CONNECTED.(%s)\n",jprint(argjson,0)); if ( (proof= jarray(&num,argjson,"proof")) != 0 && num > 0 ) LP_instantdex_proofcheck(Q.coinaddr,proof,num); if ( Qtrades == 0 ) @@ -1227,6 +1228,7 @@ int32_t LP_tradecommand(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson, else if ( strcmp(method,"connect") == 0 ) { LP_bob_competition(&counter,aliceid,qprice,1000); + printf("CONNECT.(%s)\n",jprint(argjson,0)); if ( (proof= jarray(&num,argjson,"proof")) != 0 && num > 0 ) LP_instantdex_proofcheck(Q.coinaddr,proof,num); if ( Qtrades == 0 )