Browse Source

Test

etomic
jl777 8 years ago
parent
commit
7c6537fd3b
  1. 2
      .gitignore
  2. 1
      basilisk/basilisk.c
  3. 13
      basilisk/basilisk_DEX.c
  4. 2
      iguana/iguana777.h

2
.gitignore

@ -399,3 +399,5 @@ iguana/DB/SWAPS/2723832060-1788071166
iguana/DB/SWAPS/3213598586-2281632307
iguana/DB/SWAPS/2686675855-3655454671

1
basilisk/basilisk.c

@ -1857,6 +1857,7 @@ HASH_ARRAY_STRING(InstantDEX,request,hash,vals,hexstr)
memset(hash.bytes,0,sizeof(hash));
msgid = (uint32_t)time(NULL);
DEX_channel = 'D' + ((uint32_t)'E' << 8) + ((uint32_t)'X' << 16);
myinfo->DEXtrades++; // not exact but allows a one side initiated self-trade
basilisk_channelsend(myinfo,hash,hash,DEX_channel,msgid,serialized,datalen,60);
sleep(3);
/*while ( numiters < 10 && (crc= basilisk_crcsend(myinfo,0,buf,sizeof(buf),hash,myinfo->myaddr.persistent,DEX_channel,msgid,serialized,datalen,crcs)) == 0 )

13
basilisk/basilisk_DEX.c

@ -313,11 +313,14 @@ int32_t basilisk_requests_poll(struct supernet_info *myinfo)
if ( smartaddress_pubkey(myinfo,typestr,bidasks,&privkey,issueR.src,issueR.srchash) >= 0 )
{
printf("matched dex_smartpubkey\n");
dex_channelsend(myinfo,issueR.srchash,issueR.desthash,channel,0x4000000,(void *)&issueR.requestid,sizeof(issueR.requestid)); // 60
dpow_nanomsg_update(myinfo);
dex_updateclient(myinfo);
if ( (retstr= basilisk_start(myinfo,privkey,&issueR,1,issueR.optionhours * 3600)) != 0 )
free(retstr);
if ( myinfo->DEXtrades > 0 )
{
dex_channelsend(myinfo,issueR.srchash,issueR.desthash,channel,0x4000000,(void *)&issueR.requestid,sizeof(issueR.requestid)); // 60
dpow_nanomsg_update(myinfo);
dex_updateclient(myinfo);
if ( (retstr= basilisk_start(myinfo,privkey,&issueR,1,issueR.optionhours * 3600)) != 0 )
free(retstr);
}
}
else if ( issueR.requestid != myinfo->lastdexrequestid )//if ( issueR.quoteid == 0 )
{

2
iguana/iguana777.h

@ -173,7 +173,7 @@ struct supernet_info
uint16_t psockport,numpsocks; struct psock *PSOCKS; portable_mutex_t psockmutex;
uint8_t notaries[64][33]; int32_t numnotaries,DEXEXPLORER;
FILE *swapsfp;
struct smartaddress smartaddrs[64]; int32_t numsmartaddrs,cancelrefresh,runsilent;
struct smartaddress smartaddrs[64]; int32_t numsmartaddrs,cancelrefresh,runsilent,DEXtrades;
};
struct basilisk_swapmessage

Loading…
Cancel
Save