From 1884060b522a0fdd32a6d3d5baf935fc1d29b0c3 Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 13 May 2016 20:15:48 -0500 Subject: [PATCH] test --- iguana/iguana_instantdex.c | 11 ++++++++--- iguana/tests/buy | 2 +- iguana/tests/buy2 | 2 +- iguana/tests/sell | 2 +- iguana/tests/sell2 | 2 +- 5 files changed, 12 insertions(+), 7 deletions(-) diff --git a/iguana/iguana_instantdex.c b/iguana/iguana_instantdex.c index 0b030cf52..0e4a645d2 100755 --- a/iguana/iguana_instantdex.c +++ b/iguana/iguana_instantdex.c @@ -838,7 +838,7 @@ int32_t instantdex_inv2data(struct supernet_info *myinfo,struct iguana_info *coi if ( n > 0 ) { len = iguana_inv2packet(serialized,sizeof(serialized),MSG_QUOTE,hashes,n); - printf("Send inv2[%d] -> (%s)\n",n,addr->ipaddr); + //printf("Send inv2[%d] -> (%s)\n",n,addr->ipaddr); return(iguana_queue_send(coin,addr,0,serialized,"inv2",len,0,0)); } return(-1); @@ -1143,12 +1143,17 @@ char *instantdex_checkoffer(struct supernet_info *myinfo,uint64_t *txidp,struct return(0); } *txidp = myap->orderid; + if ( instantdex_offerfind(myinfo,exchange,0,0,myap->orderid,myap->offer.base,myap->offer.rel,1,0) != 0 ) + { + printf("orderid.%llu already there\n",(long long)myap->orderid); + return(0); + } if ( (otherap= instantdex_acceptable(myinfo,exchange,myap,myap->offer.minperc)) == 0 ) { printf("instantdex_checkoffer add.%llu from.%llu to acceptableQ\n",(long long)myap->orderid,(long long)myap->offer.account); - //if ( (retstr= instantdex_sendcmd(myinfo,&myap->offer,argjson,"BTCoffer",GENESIS_PUBKEY,INSTANTDEX_HOPS,0,0,1)) != 0 ) - // free(retstr); queue_enqueue("acceptableQ",&exchange->acceptableQ,&myap->DL,0); + if ( instantdex_offerfind(myinfo,exchange,0,0,myap->orderid,myap->offer.base,myap->offer.rel,1,0) == 0 ) + printf("cant find just added to acceptableQ\n"); return(jprint(instantdex_offerjson(&myap->offer,myap->orderid),1)); } else diff --git a/iguana/tests/buy b/iguana/tests/buy index 62fc67130..67c07d1a0 100755 --- a/iguana/tests/buy +++ b/iguana/tests/buy @@ -1 +1 @@ -curl --url "http://127.0.0.1:7778" --data "{\"password\":\"test\",\"dotrade\":1,\"agent\":\"InstantDEX\",\"exchange\":\"bitcoin\",\"method\":\"buy\",\"base\":\"BTCD\",\"rel\":\"BTC\",\"price\":0.0029,\"volume\":1.0}" +curl --url "http://127.0.0.1:7778" --data "{\"dotrade\":1,\"agent\":\"InstantDEX\",\"exchange\":\"bitcoin\",\"method\":\"buy\",\"base\":\"BTCD\",\"rel\":\"BTC\",\"price\":0.0029,\"volume\":1.0}" diff --git a/iguana/tests/buy2 b/iguana/tests/buy2 index 3f6086487..252ab3c60 100755 --- a/iguana/tests/buy2 +++ b/iguana/tests/buy2 @@ -1 +1 @@ -curl --url "http://127.0.0.1:7778" --data "{\"password\":\"test2\",\"dotrade\":1,\"agent\":\"InstantDEX\",\"exchange\":\"bitcoin\",\"method\":\"buy\",\"base\":\"BTCD\",\"rel\":\"BTC\",\"price\":0.0027,\"volume\":1.0}" +curl --url "http://127.0.0.1:7778" --data "{\"dotrade\":1,\"agent\":\"InstantDEX\",\"exchange\":\"bitcoin\",\"method\":\"buy\",\"base\":\"BTCD\",\"rel\":\"BTC\",\"price\":0.0027,\"volume\":1.0}" diff --git a/iguana/tests/sell b/iguana/tests/sell index 4db541c05..c0eb0ae05 100755 --- a/iguana/tests/sell +++ b/iguana/tests/sell @@ -1 +1 @@ -curl --url "http://127.0.0.1:7778" --data "{\"password\":\"test\",\"dotrade\":1,\"agent\":\"InstantDEX\",\"exchange\":\"bitcoin\",\"method\":\"sell\",\"base\":\"BTCD\",\"rel\":\"BTC\",\"price\":0.0029,\"volume\":1.0}" +curl --url "http://127.0.0.1:7778" --data "{\"dotrade\":1,\"agent\":\"InstantDEX\",\"exchange\":\"bitcoin\",\"method\":\"sell\",\"base\":\"BTCD\",\"rel\":\"BTC\",\"price\":0.0029,\"volume\":1.0}" diff --git a/iguana/tests/sell2 b/iguana/tests/sell2 index 53207b8c9..4db541c05 100755 --- a/iguana/tests/sell2 +++ b/iguana/tests/sell2 @@ -1 +1 @@ -curl --url "http://127.0.0.1:7778" --data "{\"password\":\"test2\",\"password\":\"test\",\"dotrade\":1,\"agent\":\"InstantDEX\",\"exchange\":\"bitcoin\",\"method\":\"sell\",\"base\":\"BTCD\",\"rel\":\"BTC\",\"price\":0.0029,\"volume\":1.0}" +curl --url "http://127.0.0.1:7778" --data "{\"password\":\"test\",\"dotrade\":1,\"agent\":\"InstantDEX\",\"exchange\":\"bitcoin\",\"method\":\"sell\",\"base\":\"BTCD\",\"rel\":\"BTC\",\"price\":0.0029,\"volume\":1.0}"