diff --git a/iguana/SuperNET.c b/iguana/SuperNET.c index 9d69f7880..7a9a6a2f1 100755 --- a/iguana/SuperNET.c +++ b/iguana/SuperNET.c @@ -1469,6 +1469,7 @@ FOUR_STRINGS(SuperNET,login,handle,password,permanentfile,passphrase) if ( (str= SuperNET_encryptjson(IGUANA_CALLARGS,password,myinfo->permanentfile,argstr)) != 0 ) free(str); free(argstr); + myinfo->expiration = (uint32_t)(time(NULL) + 3600); return(SuperNET_activehandle(IGUANA_CALLARGS)); } else return(clonestr("{\"error\":\"need passphrase\"}")); printf("logged into (%s) %s %s\n",myinfo->myaddr.NXTADDR,myinfo->myaddr.BTC,myinfo->myaddr.BTCD); diff --git a/iguana/iguana777.c b/iguana/iguana777.c index b131935c2..f5a7326db 100755 --- a/iguana/iguana777.c +++ b/iguana/iguana777.c @@ -145,7 +145,7 @@ double iguana_metric(struct iguana_peer *addr,uint32_t now,double decay) int32_t iguana_inv2poll(struct supernet_info *myinfo,struct iguana_info *coin) { struct exchange_info *exchange; int32_t i,n=0; struct iguana_peer *addr; - //printf("peermetrics\n"); + printf("iguana_inv2poll\n"); if ( (exchange= exchanges777_find("bitcoin")) != 0 && strcmp(coin->symbol,"BTCD") == 0 ) { if ( time(NULL) > coin->lastinv2+10 ) diff --git a/iguana/iguana_instantdex.c b/iguana/iguana_instantdex.c index 8b08aef26..ee78e8901 100755 --- a/iguana/iguana_instantdex.c +++ b/iguana/iguana_instantdex.c @@ -709,8 +709,11 @@ struct instantdex_accept *instantdex_offerfind(struct supernet_info *ignore,stru //printf("%d %d find cmps %d %d %d %d %d %d me.%llu vs %llu o.%llu | vs %llu\n",instantdex_bidaskdir(&ap->offer),ap->offer.expiration-now,strcmp(base,"*") == 0,strcmp(base,ap->offer.base) == 0,strcmp(rel,"*") == 0,strcmp(rel,ap->offer.rel) == 0,orderid == 0,orderid == ap->orderid,(long long)myinfo->myaddr.nxt64bits,(long long)ap->offer.offer64,(long long)ap->orderid,(long long)orderid); if ( (report == 0 || ap->reported == 0) && (strcmp(base,"*") == 0 || strcmp(base,ap->offer.base) == 0) && (strcmp(rel,"*") == 0 || strcmp(rel,ap->offer.rel) == 0) && (orderid == 0 || orderid == ap->orderid) ) { - if ( report != 0 ) + if ( report != 0 && ap->reported == 0 ) + { ap->reported = 1; + printf("MARK as reported %llu\n",(long long)ap->orderid); + } if ( requeue == 0 && retap != 0 ) queue_enqueue("acceptableQ",&exchange->acceptableQ,&retap->DL,0); retap = ap; @@ -1505,7 +1508,8 @@ cJSON *instantdex_reportjson(cJSON *item,char *name) jadd(newjson,"orderid",jduplicate(jobj(item,"orderid"))); jaddnum(newjson,"date",dateval); jaddnum(newjson,"s",dateval % 60); - jaddnum(newjson,"h",(dateval / 60) % 60); + jaddnum(newjson,"m",(dateval / 60) % 60); + jaddnum(newjson,"h",(dateval / 3600) % 24); return(newjson); } @@ -1522,7 +1526,7 @@ TWO_STRINGS(InstantDEX,events,base,rel) { for (i=0; i 0 ) + { + chartData.splice(0,chartData.length); + chart.validateData(); + } +} +function BTCDbase() { changebase("BTCD"); } +function VPNbase() { changebase("VPN"); } +function SYSbase() { changebase("SYS"); } +function SuperNETbase() { changebase("SuperNET"); } +function crypto777base() { changebase("crypto777"); } +function Pangeabase() { changebase("Pangea"); } +function InstantDEXbase() { changebase("InstantDEX"); } +function Tradebotsbase() { changebase("Tradebots"); } +function NXTprivacybase() { changebase("NXTprivacy"); } function USDrel() { REL = "USD"; } function EURrel() { REL = "EUR"; } @@ -147,6 +156,7 @@ function getDataFromServer() newData = JSON.parse(response); if ( newData.length > 0 ) { + alert(response); chartData.push.apply(chartData, newData); if (chartData.length > 50) chartData.splice(0, chartData.length - 50); diff --git a/iguana/tests/events b/iguana/tests/events new file mode 100755 index 000000000..a51fc4cf7 --- /dev/null +++ b/iguana/tests/events @@ -0,0 +1 @@ +curl --url "http://127.0.0.1:7778" --data "{\"agent\":\"InstantDEX\",\"exchange\":\"bitcoin\",\"method\":\"events\",\"base\":\"BTCD\",\"rel\":\"BTC\"}" diff --git a/iguana/tests/eventsV b/iguana/tests/eventsV new file mode 100755 index 000000000..975f88de8 --- /dev/null +++ b/iguana/tests/eventsV @@ -0,0 +1 @@ +curl --url "http://127.0.0.1:7778" --data "{\"agent\":\"InstantDEX\",\"exchange\":\"bitcoin\",\"method\":\"events\",\"base\":\"VPN\",\"rel\":\"BTC\"}" diff --git a/iguana/tests/sellV b/iguana/tests/sellV new file mode 100755 index 000000000..86f12afc6 --- /dev/null +++ b/iguana/tests/sellV @@ -0,0 +1 @@ +curl --url "http://127.0.0.1:7778" --data "{\"dotrade\":1,\"agent\":\"InstantDEX\",\"exchange\":\"bitcoin\",\"method\":\"sell\",\"base\":\"VPN\",\"rel\":\"BTC\",\"price\":0.000025,\"volume\":1.0}"