jl777 8 years ago
parent
commit
38063786ea
  1. 1
      basilisk/basilisk.c
  2. 10
      basilisk/basilisk_DEX.c
  3. 1
      basilisk/basilisk_tradebot.c

1
basilisk/basilisk.c

@ -822,6 +822,7 @@ void basilisk_requests_poll(struct supernet_info *myinfo)
} else printf("null incoming\n"); } else printf("null incoming\n");
if ( hwm > 0. ) if ( hwm > 0. )
{ {
printf("hwm %f\n",hwm);
if ( bits256_cmp(myinfo->myaddr.persistent,issueR.srchash) == 0 ) // my request if ( bits256_cmp(myinfo->myaddr.persistent,issueR.srchash) == 0 ) // my request
{ {
printf("my req hwm %f\n",hwm); printf("my req hwm %f\n",hwm);

10
basilisk/basilisk_DEX.c

@ -423,7 +423,7 @@ STRING_ARG(InstantDEX,available,source)
{ {
if ( (retstr= basilisk_balances(myinfo,coin,0,0,GENESIS_PUBKEY,vals,"")) != 0 ) if ( (retstr= basilisk_balances(myinfo,coin,0,0,GENESIS_PUBKEY,vals,"")) != 0 )
{ {
printf("available.(%s)\n",retstr); //printf("available.(%s)\n",retstr);
if ( (balancejson= cJSON_Parse(retstr)) != 0 ) if ( (balancejson= cJSON_Parse(retstr)) != 0 )
{ {
if ( (unspents= jarray(&n,balancejson,"unspents")) != 0 ) if ( (unspents= jarray(&n,balancejson,"unspents")) != 0 )
@ -434,17 +434,15 @@ STRING_ARG(InstantDEX,available,source)
if ( jobj(item,"unspent") != 0 ) if ( jobj(item,"unspent") != 0 )
{ {
total += jdouble(item,"amount") * SATOSHIDEN; total += jdouble(item,"amount") * SATOSHIDEN;
printf("(%s) -> %.8f\n",jprint(item,0),dstr(total));
} }
//printf("(%s) -> %.8f\n",jprint(item,0),dstr(total));
} }
} } else printf("no unspents in available\n");
if ( total == 0 )
total = 500000;
retjson = cJSON_CreateObject(); retjson = cJSON_CreateObject();
jaddnum(retjson,"result",dstr(total)); jaddnum(retjson,"result",dstr(total));
free_json(balancejson); free_json(balancejson);
printf("n.%d total %.8f (%s)\n",n,dstr(total),jprint(retjson,0)); printf("n.%d total %.8f (%s)\n",n,dstr(total),jprint(retjson,0));
} } else printf("parse error.(%s)\n",retstr);
free(retstr); free(retstr);
} }
free_json(vals); free_json(vals);

1
basilisk/basilisk_tradebot.c

@ -216,6 +216,7 @@ double basilisk_request_listprocess(struct supernet_info *myinfo,struct basilisk
issueR->desthash = myinfo->myaddr.persistent; issueR->desthash = myinfo->myaddr.persistent;
issueR->destamount = destamount; issueR->destamount = destamount;
issueR->quotetime = (uint32_t)time(NULL); issueR->quotetime = (uint32_t)time(NULL);
printf("issueR set!\n");
} }
} }
else if ( myrequest != 0 && pendingid == 0 && maxi >= 0 ) // automatch best quote else if ( myrequest != 0 && pendingid == 0 && maxi >= 0 ) // automatch best quote

Loading…
Cancel
Save