Browse Source

Test

etomic
jl777 8 years ago
parent
commit
df06e9c979
  1. 1
      basilisk/basilisk_DEX.c
  2. 4
      basilisk/jumblr.c
  3. 4
      basilisk/smartaddress.c
  4. 4
      basilisk/tradebots_liquidity.c

1
basilisk/basilisk_DEX.c

@ -479,6 +479,7 @@ char *basilisk_respond_accept(struct supernet_info *myinfo,bits256 privkey,uint3
retstr = clonestr("{\"error\":\"couldnt find to requestid to choose\"}"); retstr = clonestr("{\"error\":\"couldnt find to requestid to choose\"}");
return(retstr); return(retstr);
} }
cJSON *basilisk_unspents(struct supernet_info *myinfo,struct iguana_info *coin,char *coinaddr) cJSON *basilisk_unspents(struct supernet_info *myinfo,struct iguana_info *coin,char *coinaddr)
{ {
cJSON *unspents=0,*array=0; char *retstr; cJSON *unspents=0,*array=0; char *retstr;

4
basilisk/jumblr.c

@ -215,7 +215,7 @@ int64_t jumblr_balance(struct supernet_info *myinfo,struct iguana_info *coin,cha
} }
else if ( (retstr= dex_getbalance(myinfo,coin,0,0,coin->symbol,addr)) != 0 ) else if ( (retstr= dex_getbalance(myinfo,coin,0,0,coin->symbol,addr)) != 0 )
{ {
printf("DEX retstr.(%s)\n",retstr); //printf("DEX retstr.(%s)\n",retstr);
if ( (retjson= cJSON_Parse(retstr)) != 0 ) if ( (retjson= cJSON_Parse(retstr)) != 0 )
{ {
balance = jdouble(retjson,"balance") * SATOSHIDEN; balance = jdouble(retjson,"balance") * SATOSHIDEN;
@ -714,7 +714,7 @@ void jumblr_CMCname(char *CMCname,char *symbol)
void jumblr_DEXcheck(struct supernet_info *myinfo,struct iguana_info *coin) void jumblr_DEXcheck(struct supernet_info *myinfo,struct iguana_info *coin)
{ {
double vol,avail; struct iguana_info *kmdcoin,*coinbtc = 0; double vol,avail; struct iguana_info *kmdcoin,*coinbtc = 0;
if ( myinfo->IAMNOTARY != 0 ) if ( myinfo->IAMNOTARY != 0 || myinfo->IAMLP != 0 )
return; return;
if ( (kmdcoin= iguana_coinfind("KMD")) == 0 || (coinbtc= iguana_coinfind("BTC")) == 0 ) if ( (kmdcoin= iguana_coinfind("KMD")) == 0 || (coinbtc= iguana_coinfind("BTC")) == 0 )
return; return;

4
basilisk/smartaddress.c

@ -17,8 +17,7 @@
int32_t smartaddress_add(struct supernet_info *myinfo,bits256 privkey,char *BTCaddr,char *KMDaddr) int32_t smartaddress_add(struct supernet_info *myinfo,bits256 privkey,char *BTCaddr,char *KMDaddr)
{ {
struct smartaddress *ap; char coinaddr[64]; uint8_t addrtype,rmd160[20]; struct smartaddress *ap; int32_t i;
int32_t i;
if ( myinfo->numsmartaddrs < sizeof(myinfo->smartaddrs)/sizeof(*myinfo->smartaddrs) ) if ( myinfo->numsmartaddrs < sizeof(myinfo->smartaddrs)/sizeof(*myinfo->smartaddrs) )
{ {
for (i=0; i<myinfo->numsmartaddrs; i++) for (i=0; i<myinfo->numsmartaddrs; i++)
@ -29,7 +28,6 @@ int32_t smartaddress_add(struct supernet_info *myinfo,bits256 privkey,char *BTCa
bitcoin_pubkey33(myinfo->ctx,ap->pubkey33,privkey); bitcoin_pubkey33(myinfo->ctx,ap->pubkey33,privkey);
calc_rmd160_sha256(ap->rmd160,ap->pubkey33,33); calc_rmd160_sha256(ap->rmd160,ap->pubkey33,33);
ap->pubkey = curve25519(privkey,curve25519_basepoint9()); ap->pubkey = curve25519(privkey,curve25519_basepoint9());
char coinaddr[64]; uint8_t addrtype,rmd160[20];
bitcoin_address(coinaddr,0,ap->pubkey33,33); bitcoin_address(coinaddr,0,ap->pubkey33,33);
for (i=0; i<20; i++) for (i=0; i<20; i++)
printf("%02x",ap->rmd160[i]); printf("%02x",ap->rmd160[i]);

4
basilisk/tradebots_liquidity.c

@ -984,7 +984,7 @@ void _default_liquidity_command(struct supernet_info *myinfo,char *base,bits256
} else tradebot_monitor(myinfo,0,0,0,li.exchange,li.base,li.rel,0.); } else tradebot_monitor(myinfo,0,0,0,li.exchange,li.base,li.rel,0.);
} }
myinfo->linfos[i] = li; myinfo->linfos[i] = li;
printf("Set linfo[%d] %s (%s/%s) profitmargin %.6f bid %.8f ask %.8f minvol %.6f maxvol %.6f ref %.8f <- (%s)\n",i,li.exchange,li.base,li.rel,li.profit,li.bid,li.ask,li.minvol,li.maxvol,li.refprice,jprint(vals,0)); //printf("Set linfo[%d] %s (%s/%s) profitmargin %.6f bid %.8f ask %.8f minvol %.6f maxvol %.6f ref %.8f <- (%s)\n",i,li.exchange,li.base,li.rel,li.profit,li.bid,li.ask,li.minvol,li.maxvol,li.refprice,jprint(vals,0));
return; return;
} }
} }
@ -1150,7 +1150,7 @@ void tradebot_swap_balancingtrade(struct supernet_info *myinfo,struct basilisk_s
else if ( swap->DEXselector == 2 ) else if ( swap->DEXselector == 2 )
kmdcoin->DEXinfo.KMDpending -= swap->I.req.srcamount; kmdcoin->DEXinfo.KMDpending -= swap->I.req.srcamount;
} }
printf(">>>>>>>>>>>>>>>>>> balancing trade\n"); printf(">>>>>>>>>>>>>>>>>> balancing trade done by marketmaker\n");
return; return;
if ( swap->balancingtrade == 0 ) if ( swap->balancingtrade == 0 )
_default_swap_balancingtrade(myinfo,swap,iambob); _default_swap_balancingtrade(myinfo,swap,iambob);

Loading…
Cancel
Save