From 2f3122a8a6480e6a18b9d9bfd5bff36af60dc404 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 20 Sep 2016 08:02:47 -0300 Subject: [PATCH] test --- basilisk/basilisk_tradebot.c | 2 ++ iguana/iguana_unspents.c | 4 ++-- iguana/tests/LPinit | 1 + iguana/tests/decoderawtransaction | 2 +- 4 files changed, 6 insertions(+), 3 deletions(-) create mode 100644 iguana/tests/LPinit diff --git a/basilisk/basilisk_tradebot.c b/basilisk/basilisk_tradebot.c index 39b750f1a..2656fc468 100755 --- a/basilisk/basilisk_tradebot.c +++ b/basilisk/basilisk_tradebot.c @@ -192,6 +192,8 @@ double basilisk_request_listprocess(struct supernet_info *myinfo,struct basilisk { if ( (aveprice= instantdex_avehbla(myinfo,retvals,list[0].src,list[0].dest,1.3 * dstr(list[0].srcamount))) == 0. || refprice > aveprice ) aveprice = refprice; + if ( fabs(aveprice) < SMALLVAL ) + return(0); destamount = (1.0 - profitmargin) * aveprice * list[0].srcamount; if ( (retstr= InstantDEX_available(myinfo,iguana_coinfind(list[0].dest),0,0,list[0].dest)) != 0 ) { diff --git a/iguana/iguana_unspents.c b/iguana/iguana_unspents.c index 7b7af4af4..414bc9f9a 100755 --- a/iguana/iguana_unspents.c +++ b/iguana/iguana_unspents.c @@ -835,8 +835,8 @@ int32_t iguana_RTunspent_check(struct supernet_info *myinfo,struct iguana_info * { bits256 txid; int32_t vout,spentheight; memset(&txid,0,sizeof(txid)); - //if ( coin->FULLNODE == 0 && coin->VALIDATENODE == 0 ) - // return(0); + if ( coin->FULLNODE == 0 && coin->VALIDATENODE == 0 ) + return(0); if ( iguana_RTunspentind2txid(myinfo,coin,&spentheight,&txid,&vout,outpt) == 0 ) { //char str[65]; printf("verify %s/v%d is not already used\n",bits256_str(str,txid),vout); diff --git a/iguana/tests/LPinit b/iguana/tests/LPinit new file mode 100644 index 000000000..a52902733 --- /dev/null +++ b/iguana/tests/LPinit @@ -0,0 +1 @@ +curl --url "http://127.0.0.1:7778" --data "{\"agent\":\"tradebot\",\"method\":\"liquidity\",\"targetcoin\",\"BTCD\",\"vals\":{\"profit\":0.005}}" diff --git a/iguana/tests/decoderawtransaction b/iguana/tests/decoderawtransaction index 09a16c3a8..6a00a8aff 100755 --- a/iguana/tests/decoderawtransaction +++ b/iguana/tests/decoderawtransaction @@ -1 +1 @@ -curl --url "http://127.0.0.1:7778" --data "{\"coin\":\"SYS\",\"method\":\"decoderawtransaction\",\"params\":[\"0100000002006a9affa9b868cd4da9598f9a311bc8315dd0beafcdc4066f7eb4a55d19fae80100000000ffffffff00bcb83647bdcf661a4e71e96ee0ee84f77f09e278120a9479e19c709238963d0000000000ffffffff0210270000000000001976a914df3f034f9805301d881b0d8c24a106f8d4c7fc8c88acdc840100000000001976a9142f4c0f91fc06ac228c120aee41741d0d3909683288ac00000000\", 1]}" +curl --url "http://127.0.0.1:7778" --data "{\"coin\":\"SYS\",\"method\":\"decoderawtransaction\",\"params\":[\"010000000100bcb83647bdcf661a4e71e96ee0ee84f77f09e278120a9479e19c709238963d0000000000ffffffff0210270000000000001976a914df3f034f9805301d881b0d8c24a106f8d4c7fc8c88ac9e370100000000001976a9142f4c0f91fc06ac228c120aee41741d0d3909683288ac00000000\", 1]}"