Browse Source

Test

etomic
jl777 7 years ago
parent
commit
4adcaa9eee
  1. 16
      iguana/exchanges/LP_commands.c
  2. 8
      iguana/exchanges/LP_zeroconf.c

16
iguana/exchanges/LP_commands.c

@ -292,6 +292,22 @@ zeroconf_claim(address, expiration=0)\n\
return(basilisk_swapentries(base,rel,jint(argjson,"limit")));
else return(basilisk_swaplist(0,0));
}
else if ( strcmp(method,"dynamictrust") == 0 )
{
struct LP_address *ap; char *coinaddr;
if ( (ptr= LP_coinsearch("KMD")) != 0 && (coinaddr= jstr(argjson,"address")) != 0 )
{
if ( (ap= LP_addressfind(ptr,coinaddr)) != 0 )
{
retjson = cJSON_CreateObject();
jaddstr(retjson,"result","success");
jaddstr(retjson,"address",coinaddr);
jaddnum(retjson,"zcredits",dstr(ap->zeroconf_credits));
return(jprint(retjson,1));
}
}
return(clonestr("{\"error\":\"cant find address\"}"));
}
else if ( (retstr= LP_istradebots_command(ctx,pubsock,method,argjson)) != 0 )
return(retstr);
if ( base[0] != 0 && rel[0] != 0 )

8
iguana/exchanges/LP_zeroconf.c

@ -206,7 +206,11 @@ void LP_zeroconf_credit(char *coinaddr,uint64_t satoshis,int32_t weeki,char *p2s
void LP_zeroconf_deposits(struct iguana_info *coin)
{
cJSON *array,*item,*txjson,*vouts,*v,*txobj; int32_t i,n,numvouts,height,vout,weeki; bits256 txid; char destaddr[64],p2shaddr[64]; int64_t satoshis,amount64;
cJSON *array,*item,*txjson,*vouts,*v,*txobj; int32_t i,n,numvouts,height,vout,weeki; bits256 txid; char destaddr[64],p2shaddr[64]; struct LP_address *ap,*tmp; int64_t satoshis,amount64;
HASH_ITER(hh,coin->addresses,ap,tmp)
{
ap->zeroconf_credits = 0;
}
if ( (array= LP_listreceivedbyaddress("KMD",BOTS_BONDADDRESS)) != 0 )
{
//printf("ZEROCONF.(%s)\n",jprint(array,0));
@ -252,7 +256,7 @@ int64_t LP_dynamictrust(bits256 pubkey,int64_t kmdvalue)
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 )
if ((ap= LP_address(coin,coinaddr)) != 0 )//&& ap->zeroconf_credits >= kmdvalue )
{
DL_FOREACH_SAFE(pubp->bobswaps,ptr,tmp)
{

Loading…
Cancel
Save