diff --git a/.gitignore b/.gitignore index 1295737f8..2552af19a 100755 --- a/.gitignore +++ b/.gitignore @@ -390,3 +390,5 @@ iguana/DB/SWAPS/2723832060-1788071166 iguana/DB/SWAPS/3210648667-2626363704 iguana/DB/SWAPS/415703857-2769362858 + +iguana/DB/SWAPS/3213598586-2281632307 diff --git a/basilisk/basilisk_swap.c b/basilisk/basilisk_swap.c index 8b0b6c96e..8c387928f 100755 --- a/basilisk/basilisk_swap.c +++ b/basilisk/basilisk_swap.c @@ -1800,14 +1800,14 @@ struct basilisk_swap *bitcoin_swapinit(struct supernet_info *myinfo,bits256 priv printf(">>>>>>>>>> jumblrflag.%d <<<<<<<<< use smart address, %.8f bobconfs.%d, %.8f aliceconfs.%d\n",jumblrflag,dstr(swap->I.bobsatoshis),swap->I.bobconfirms,dstr(swap->I.alicesatoshis),swap->I.aliceconfirms); if ( swap->I.iambob != 0 ) { - basilisk_rawtx_setparms("myfee",swap->I.req.quoteid,&swap->myfee,swap->bobcoin,0,0,swap->I.bobsatoshis/INSTANTDEX_DECKSIZE,0,0,jumblrflag); - basilisk_rawtx_setparms("otherfee",swap->I.req.quoteid,&swap->otherfee,swap->alicecoin,0,0,swap->I.alicesatoshis/INSTANTDEX_DECKSIZE,0,0,jumblrflag); + basilisk_rawtx_setparms("myfee",swap->I.req.quoteid,&swap->myfee,swap->bobcoin,0,0,swap->I.bobsatoshis/INSTANTDEX_INSURANCEDIV,0,0,jumblrflag); + basilisk_rawtx_setparms("otherfee",swap->I.req.quoteid,&swap->otherfee,swap->alicecoin,0,0,swap->I.alicesatoshis/INSTANTDEX_INSURANCEDIV,0,0,jumblrflag); bobpub33 = pubkey33; } else { - basilisk_rawtx_setparms("otherfee",swap->I.req.quoteid,&swap->otherfee,swap->bobcoin,0,0,swap->I.bobsatoshis/INSTANTDEX_DECKSIZE,0,0,jumblrflag); - basilisk_rawtx_setparms("myfee",swap->I.req.quoteid,&swap->myfee,swap->alicecoin,0,0,swap->I.alicesatoshis/INSTANTDEX_DECKSIZE,0,0,jumblrflag); + basilisk_rawtx_setparms("otherfee",swap->I.req.quoteid,&swap->otherfee,swap->bobcoin,0,0,swap->I.bobsatoshis/INSTANTDEX_INSURANCEDIV,0,0,jumblrflag); + basilisk_rawtx_setparms("myfee",swap->I.req.quoteid,&swap->myfee,swap->alicecoin,0,0,swap->I.alicesatoshis/INSTANTDEX_INSURANCEDIV,0,0,jumblrflag); alicepub33 = pubkey33; } basilisk_rawtx_setparms("bobdeposit",swap->I.req.quoteid,&swap->bobdeposit,swap->bobcoin,swap->I.bobconfirms,0,swap->I.bobsatoshis + (swap->I.bobsatoshis>>3) + swap->bobcoin->txfee,4,0,jumblrflag); @@ -2431,7 +2431,7 @@ void basilisk_psockinit(struct supernet_info *myinfo,struct basilisk_swap *swap, } free_json(retjson); } - printf("KVsearch.(%s) connected.%d socks.(%d %d)\n",retstr,swap->connected,swap->pushsock,swap->subsock); + printf("KVsearch.(%s) -> (%s) connected.%d socks.(%d %d)\n",keystr,retstr,swap->connected,swap->pushsock,swap->subsock); free(retstr); } if ( swap->connected <= 0 && amlp != 0 ) diff --git a/basilisk/jumblr.c b/basilisk/jumblr.c index 242fd2db4..19835f98c 100755 --- a/basilisk/jumblr.c +++ b/basilisk/jumblr.c @@ -737,10 +737,10 @@ void jumblr_DEXcheck(struct supernet_info *myinfo,struct iguana_info *coin,int32 double minbtc,minkmd,btcavail; char *retstr; cJSON *vals; bits256 hash; minbtc = (kmdcoin->DEXinfo.btcprice * 1.2) * (JUMBLR_INCR + 3*(JUMBLR_INCR * JUMBLR_FEE + JUMBLR_TXFEE)); btcavail = dstr(jumblr_balance(myinfo,coinbtc,kmdcoin->DEXinfo.depositaddr)); + avail = (btcavail - kmdcoin->DEXinfo.DEXpending); + printf("BTC.%d deposits %.8f, min %.8f avail %.8f pending %.8f\n",toKMD,btcavail,minbtc,avail,kmdcoin->DEXinfo.DEXpending); if ( toKMD == 0 && coinbtc != 0 && btcavail > (minbtc + kmdcoin->DEXinfo.DEXpending) ) { - avail = (btcavail - kmdcoin->DEXinfo.DEXpending); - printf("BTC deposits %.8f, min %.8f avail %.8f\n",btcavail,minbtc,avail); /*if ( avail >= (100. * minbtc) ) vol = (100. * minbtc); else if ( avail >= (10. * minbtc) ) @@ -770,10 +770,10 @@ void jumblr_DEXcheck(struct supernet_info *myinfo,struct iguana_info *coin,int32 } } //else printf("btcavail %.8f pending %.8f\n",btcavail,pending); minkmd = 100.; + avail = (kmdcoin->DEXinfo.KMDavail - kmdcoin->DEXinfo.KMDpending); + printf("KMD.%d deposits %.8f, min %.8f, avail %.8f pending %.8f\n",toKMD,kmdcoin->DEXinfo.KMDavail,minkmd,avail,kmdcoin->DEXinfo.KMDpending); if ( toKMD != 0 && coinbtc != 0 && kmdcoin->DEXinfo.KMDavail > (minkmd + kmdcoin->DEXinfo.KMDpending) ) { - avail = (kmdcoin->DEXinfo.KMDavail - kmdcoin->DEXinfo.KMDpending); - printf("KMD deposits %.8f, min %.8f, avail %.8f\n",kmdcoin->DEXinfo.KMDavail,minkmd,avail); /*if ( avail > 100.*JUMBLR_INCR ) vol = 100.*JUMBLR_INCR; else if ( avail > 10.*JUMBLR_INCR ) diff --git a/iguana/tests/dexgetbalance b/iguana/tests/dexgetbalance index 71efdf9af..25bc1f680 100755 --- a/iguana/tests/dexgetbalance +++ b/iguana/tests/dexgetbalance @@ -1,2 +1,2 @@ #!/bin/bash -curl --url "http://127.0.0.1:7778" --data "{\"agent\":\"dex\",\"method\":\"getbalance\",\"address\":\"RAGhCfNvxpL55JFV7h2HQa5dSEK86Jg3ic\",\"symbol\":\"KMD\"}" +curl --url "http://127.0.0.1:7778" --data "{\"agent\":\"dex\",\"method\":\"getbalance\",\"address\":\"RRvaVyKS59NJWhPp8Pn7mVPGhMuhJJXrdh\",\"symbol\":\"KMD\"}"