Browse Source

Test

etomic
jl777 7 years ago
parent
commit
ad64b5a4ef
  1. 1
      iguana/exchanges/LP_nativeDEX.c
  2. 3
      iguana/exchanges/LP_zeroconf.c
  3. 4
      iguana/exchanges/stats.c

1
iguana/exchanges/LP_nativeDEX.c

@ -18,7 +18,6 @@
// marketmaker
//
// feature requests:
// listtransactions for zeroconf credits in native
// alice waiting for bestprice
// USD paxprice based USDvalue in portfolio
// cancel bid/ask

3
iguana/exchanges/LP_zeroconf.c

@ -251,6 +251,7 @@ int64_t LP_dynamictrust(bits256 pubkey,int64_t kmdvalue)
struct LP_pubswap *ptr,*tmp; struct LP_swapstats *sp; struct LP_pubkey_info *pubp; struct LP_address *ap; char coinaddr[64]; struct iguana_info *coin; int64_t swaps_kmdvalue = 0;
if ( (coin= LP_coinfind("KMD")) != 0 && (pubp= LP_pubkeyfind(pubkey)) != 0 )
{
bitcoin_address(coinaddr,coin->taddr,coin->pubtype,pubp->pubsecp,33);
if ((ap= LP_address(coin,coinaddr)) != 0 && ap->zeroconf_credits >= kmdvalue )
{
DL_FOREACH_SAFE(pubp->bobswaps,ptr,tmp)
@ -263,7 +264,7 @@ int64_t LP_dynamictrust(bits256 pubkey,int64_t kmdvalue)
if ( (sp= ptr->swap) != 0 && sp->finished == 0 && sp->expired == 0 )
swaps_kmdvalue += LP_kmdvalue(sp->Q.destcoin,sp->Q.destsatoshis);
}
//printf("credits %.8f vs (%.8f + current %.8f)\n",dstr(ap->zeroconf_credits),dstr(swaps_kmdvalue),dstr(kmdvalue));
printf("%s zeroconf_credits %.8f vs (%.8f + current %.8f)\n",coinaddr,dstr(ap->zeroconf_credits),dstr(swaps_kmdvalue),dstr(kmdvalue));
if ( ap->zeroconf_credits > swaps_kmdvalue+kmdvalue )
return(ap->zeroconf_credits - (swaps_kmdvalue+kmdvalue));
}

4
iguana/exchanges/stats.c

@ -624,7 +624,7 @@ void LP_rpc_processreq(void *_ptr)
printf("EAGAIN for len %d, remains.%d\n",len,remains);
usleep(10000);
}
printf("errno.%d len.%d remains.%d\n",errno,len,remains);
//printf("errno.%d len.%d remains.%d\n",errno,len,remains);
break;
}
else
@ -789,7 +789,7 @@ void stats_rpcloop(void *args)
memcpy(&ipbits,&cli_addr.sin_addr.s_addr,sizeof(ipbits));
if ( port == RPC_port && ipbits != localhostbits )
{
printf("port.%u RPC_port.%u ipbits %x != %x\n",port,RPC_port,ipbits,localhostbits);
//printf("port.%u RPC_port.%u ipbits %x != %x\n",port,RPC_port,ipbits,localhostbits);
closesocket(sock);
continue;
}

Loading…
Cancel
Save