Browse Source

Test

etomic
jl777 8 years ago
parent
commit
b7134e6fd6
  1. 7
      basilisk/basilisk_DEX.c
  2. 7
      basilisk/jumblr.c

7
basilisk/basilisk_DEX.c

@ -231,14 +231,15 @@ int32_t basilisk_request_create(struct basilisk_request *rp,cJSON *valsobj,bits2
char *basilisk_start(struct supernet_info *myinfo,bits256 privkey,struct basilisk_request *_rp,uint32_t statebits,int32_t optionduration)
{
cJSON *retjson; struct basilisk_request *rp=0; int32_t i,reqmatch;
cJSON *retjson; struct basilisk_request *rp=0; int32_t i,srcmatch,destmatch;
if ( _rp->requestid == myinfo->lastdexrequestid )
{
//printf("filter duplicate r%u\n",_rp->requestid);
return(clonestr("{\"error\":\"filter duplicate requestid\"}"));
}
reqmatch = (bits256_cmp(_rp->srchash,myinfo->myaddr.persistent) == 0 || bits256_cmp(_rp->srchash,myinfo->jumblr_pubkey) == 0 || bits256_cmp(_rp->srchash,myinfo->jumblr_depositkey) == 0);
if ( (reqmatch != 0 || bits256_cmp(_rp->desthash,myinfo->myaddr.persistent) == 0) )
srcmatch = (bits256_cmp(_rp->srchash,myinfo->myaddr.persistent) == 0 || bits256_cmp(_rp->srchash,myinfo->jumblr_pubkey) == 0 || bits256_cmp(_rp->srchash,myinfo->jumblr_depositkey) == 0);
destmatch = (bits256_cmp(_rp->desthash,myinfo->myaddr.persistent) == 0 || bits256_cmp(_rp->desthash,myinfo->jumblr_pubkey) == 0 || bits256_cmp(_rp->desthash,myinfo->jumblr_depositkey) == 0);
if ( srcmatch != 0 || destmatch != 0 )
{
for (i=0; i<myinfo->numswaps; i++)
if ( myinfo->swaps[i]->I.req.requestid == _rp->requestid )

7
basilisk/jumblr.c

@ -383,12 +383,13 @@ void jumblr_DEXcheck(struct supernet_info *myinfo,struct iguana_info *coinkmd,ch
printf("BTC deposits %.8f, min %.8f\n",btcavail,minbtc);
vals = cJSON_CreateObject();
jaddstr(vals,"source","BTC");
jaddbits256(vals,"srchash",curve25519(privkey,curve25519_basepoint9()));
hash = curve25519(privkey,curve25519_basepoint9());
jaddbits256(vals,"srchash",hash);
jaddstr(vals,"dest","KMD");
jaddnum(vals,"amount",btcavail*.3);
jaddnum(vals,"minprice",kmdprice*.95);
//jaddnum(vals,"usejumblr",1);
memset(hash.bytes,0,sizeof(hash));
jaddnum(vals,"usejumblr",1);
//memset(hash.bytes,0,sizeof(hash));
pending = btcavail;
if ( (retstr= InstantDEX_request(myinfo,coinbtc,0,0,hash,vals,"")) != 0 )
{

Loading…
Cancel
Save