Browse Source

Test

etomic
jl777 7 years ago
parent
commit
6ac91582a0
  1. 6
      iguana/exchanges/LP_socket.c
  2. 7
      iguana/exchanges/LP_transaction.c

6
iguana/exchanges/LP_socket.c

@ -407,8 +407,6 @@ int32_t electrum_kickstart(struct electrum_info *ep)
return(0); return(0);
} }
int32_t zeroval() { return(0); }
cJSON *electrum_submit(char *symbol,struct electrum_info *ep,cJSON **retjsonp,char *method,char *params,int32_t timeout) cJSON *electrum_submit(char *symbol,struct electrum_info *ep,cJSON **retjsonp,char *method,char *params,int32_t timeout)
{ {
// queue id and string and callback // queue id and string and callback
@ -419,9 +417,7 @@ cJSON *electrum_submit(char *symbol,struct electrum_info *ep,cJSON **retjsonp,ch
{ {
if ( strcmp(ep->symbol,symbol) != 0 ) if ( strcmp(ep->symbol,symbol) != 0 )
{ {
printf("ep.%p %s %s:%u called for [%s]???\n",ep,ep->symbol,ep->ipaddr,ep->port,symbol); printf("electrum_submit ep.%p %s %s:%u called for [%s]???\n",ep,ep->symbol,ep->ipaddr,ep->port,symbol);
int32_t i = 1 / zeroval();
printf("it should be dead already.%d\n",i);
} }
if ( ep != 0 && ep->sock >= 0 && retjsonp != 0 ) if ( ep != 0 && ep->sock >= 0 && retjsonp != 0 )
{ {

7
iguana/exchanges/LP_transaction.c

@ -854,7 +854,7 @@ int64_t LP_komodo_interest(bits256 txid,int64_t value)
int32_t LP_vins_select(void *ctx,struct iguana_info *coin,int64_t *totalp,int64_t amount,struct vin_info *V,struct LP_address_utxo **utxos,int32_t numunspents,int32_t suppress_pubkeys,int32_t ignore_cltverr,bits256 privkey,cJSON *privkeys,cJSON *vins,uint8_t *script,int32_t scriptlen,bits256 utxotxid,int32_t utxovout,int32_t dustcombine) int32_t LP_vins_select(void *ctx,struct iguana_info *coin,int64_t *totalp,int64_t amount,struct vin_info *V,struct LP_address_utxo **utxos,int32_t numunspents,int32_t suppress_pubkeys,int32_t ignore_cltverr,bits256 privkey,cJSON *privkeys,cJSON *vins,uint8_t *script,int32_t scriptlen,bits256 utxotxid,int32_t utxovout,int32_t dustcombine)
{ {
char wifstr[128],spendscriptstr[128],str[65]; int32_t i,j,n,numpre,ind,abovei,belowi,maxmode=0; struct vin_info *vp; cJSON *txobj; struct LP_address_utxo *up,*min0,*min1,*preselected[3]; int64_t value,interest,interestsum,above,below,remains = amount,total = 0; char wifstr[128],spendscriptstr[128],str[65]; int32_t i,j,maxiters,n,numpre,ind,abovei,belowi,maxmode=0; struct vin_info *vp; cJSON *txobj; struct LP_address_utxo *up,*min0,*min1,*preselected[3]; int64_t value,interest,interestsum,above,below,remains = amount,total = 0;
*totalp = 0; *totalp = 0;
interestsum = 0; interestsum = 0;
init_hexbytes_noT(spendscriptstr,script,scriptlen); init_hexbytes_noT(spendscriptstr,script,scriptlen);
@ -923,7 +923,8 @@ int32_t LP_vins_select(void *ctx,struct iguana_info *coin,int64_t *totalp,int64_
preselected[numpre++] = min1; preselected[numpre++] = min1;
else min1 = 0; else min1 = 0;
printf("dustcombine.%d numpre.%d min0.%p min1.%p numutxos.%d amount %.8f\n",dustcombine,numpre,min0,min1,numunspents,dstr(amount)); printf("dustcombine.%d numpre.%d min0.%p min1.%p numutxos.%d amount %.8f\n",dustcombine,numpre,min0,min1,numunspents,dstr(amount));
for (i=0; i<numunspents+numpre; i++) maxiters = numunspents+numpre;
for (i=0; i<maxiters; i++)
{ {
if ( i < numpre ) if ( i < numpre )
{ {
@ -971,7 +972,7 @@ int32_t LP_vins_select(void *ctx,struct iguana_info *coin,int64_t *totalp,int64_
char str[65]; printf("%s/%d %.8f interest %.8f -> sum %.8f\n",bits256_str(str,up->U.txid),up->U.vout,dstr(up->U.value),dstr(interest),dstr(interestsum)); char str[65]; printf("%s/%d %.8f interest %.8f -> sum %.8f\n",bits256_str(str,up->U.txid),up->U.vout,dstr(up->U.value),dstr(interest),dstr(interestsum));
} }
} }
printf("vini.%d value %.8f, total %.8f remains %.8f interest %.8f sum %.8f\n",n,dstr(up->U.value),dstr(total),dstr(remains),dstr(interest),dstr(interestsum)); printf("numunspents.%d vini.%d value %.8f, total %.8f remains %.8f interest %.8f sum %.8f\n",numunspents,n,dstr(up->U.value),dstr(total),dstr(remains),dstr(interest),dstr(interestsum));
vp = &V[n++]; vp = &V[n++];
vp->N = vp->M = 1; vp->N = vp->M = 1;
vp->signers[0].privkey = privkey; vp->signers[0].privkey = privkey;

Loading…
Cancel
Save