Browse Source

Test

etomic
jl777 7 years ago
parent
commit
b19e6a3e9a
  1. 1
      iguana/exchanges/LP_include.h
  2. 17
      iguana/exchanges/LP_instantdex.c
  3. 2
      iguana/exchanges/LP_utxo.c

1
iguana/exchanges/LP_include.h

@ -500,6 +500,7 @@ struct LP_address *_LP_addressadd(struct iguana_info *coin,char *coinaddr);
int32_t iguana_signrawtransaction(void *ctx,char *symbol,uint8_t wiftaddr,uint8_t taddr,uint8_t pubtype,uint8_t p2shtype,uint8_t isPoS,int32_t height,struct iguana_msgtx *msgtx,char **signedtxp,bits256 *signedtxidp,struct vin_info *V,int32_t numinputs,char *rawtx,cJSON *vins,cJSON *privkeysjson,int32_t zcash);
//void LP_butxo_swapfields_set(struct LP_utxoinfo *butxo);
struct LP_address_utxo *LP_address_utxofind(struct iguana_info *coin,char *coinaddr,bits256 txid,int32_t vout);
int64_t LP_myzcredits();
int32_t LP_destaddr(char *destaddr,cJSON *item);
int32_t LP_waitmempool(char *symbol,char *coinaddr,bits256 txid,int32_t vout,int32_t duration);
cJSON *LP_statslog_disp(uint32_t starttime,uint32_t endtime,char *refgui,bits256 refpubkey,char *refbase,char *refrel);

17
iguana/exchanges/LP_instantdex.c

@ -424,5 +424,20 @@ int64_t LP_instantdex_proofcheck(char *coinaddr,cJSON *proof,int32_t num)
printf("validated instantdex %s.[%d] proof.(%s) credits %.8f net %.8f\n",othersmartaddr,num,jprint(proof,0),dstr(ap->instantdex_credits),dstr(net));
} else printf("cant find ap.%p or already did %d %.8f\n",ap,ap!=0?ap->didinstantdex:-1,ap!=0?dstr(ap->instantdex_credits):-1);
}
return(net);
return(ap->instantdex_credits);
}
int64_t LP_myzcredits()
{
cJSON *proof; struct iguana_info *coin; int64_t zcredits;
if ( (coin= LP_coinfind("KMD")) != 0 )
{
if ( (proof= LP_instantdex_txids()) != 0 )
{
zcredits = LP_instantdex_proofcheck(coin->smartaddr,proof,cJSON_GetArraySize(proof));
free_json(proof);
return(zcredits);
}
}
return(0);
}

2
iguana/exchanges/LP_utxo.c

@ -619,6 +619,8 @@ cJSON *LP_address_balance(struct iguana_info *coin,char *coinaddr,int32_t electr
jaddstr(retjson,"coin",coin->symbol);
jaddstr(retjson,"address",coinaddr);
jaddnum(retjson,"balance",dstr(balance));
if ( strcmp(coin->symbol,"KMD") == 0 )
jaddnum(retjson,"zcredits",dstr(LP_myzcredits()));
return(retjson);
}

Loading…
Cancel
Save