Browse Source

Test

patch-5
jl777 6 years ago
parent
commit
3e82a14ef0
  1. 2
      iguana/exchanges/LP_include.h
  2. 6
      iguana/exchanges/LP_transaction.c
  3. 6
      iguana/exchanges/LP_utxo.c

2
iguana/exchanges/LP_include.h

@ -321,7 +321,7 @@ struct iguana_info
bits256 cachedmerkle,notarizedhash; int32_t cachedmerkleheight;
};
struct _LP_utxoinfo { bits256 txid; uint64_t value; int32_t vout,height; };
struct _LP_utxoinfo { bits256 txid; uint64_t value; int32_t vout:30,suppress:1,pad:1,height; };
struct LP_utxostats { uint32_t sessionid,lasttime,errors,swappending,spentflag,lastspentcheck,bestflag; };

6
iguana/exchanges/LP_transaction.c

@ -1059,7 +1059,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)
{
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;
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,*sobj; struct LP_address_utxo *up,*min0,*min1,*preselected[3]; int64_t value,interest,interestsum,above,below,remains = amount,total = 0;
*totalp = 0;
interestsum = 0;
init_hexbytes_noT(spendscriptstr,script,scriptlen);
@ -1083,6 +1083,8 @@ int32_t LP_vins_select(void *ctx,struct iguana_info *coin,int64_t *totalp,int64_
{
up->spendheight = 1;
utxos[j] = 0;
if ( (sobj= jstr(txobj,"scriptPubKey")) != 0 && jstr(sobj,"hex") != 0 && strlen(jstr(sobj,"hex")) == 35*2 )
up->suppress = 1;
}
else
{
@ -1211,7 +1213,7 @@ int32_t LP_vins_select(void *ctx,struct iguana_info *coin,int64_t *totalp,int64_
vp->signers[0].privkey = privkey;
jaddistr(privkeys,wifstr);
bitcoin_pubkey33(ctx,vp->signers[0].pubkey,privkey);
vp->suppress_pubkeys = suppress_pubkeys;
vp->suppress_pubkeys = up->suppress;
vp->ignore_cltverr = ignore_cltverr;
jaddi(vins,LP_inputjson(up->U.txid,up->U.vout,spendscriptstr));
LP_unavailableset(up->U.txid,up->U.vout,(uint32_t)time(NULL)+LP_RESERVETIME*2,G.LP_mypub25519);

6
iguana/exchanges/LP_utxo.c

@ -580,20 +580,20 @@ struct LP_address *LP_address_utxo_reset(int32_t *nump,struct iguana_info *coin)
{
if ( (txobj= LP_gettxout(coin->symbol,coin->smartaddr,txid,vout)) == 0 )
{
printf("skip null gettxout %s.v%d\n",bits256_str(str,txid),vout);
//printf("skip null gettxout %s.v%d\n",bits256_str(str,txid),vout);
continue;
}
else free_json(txobj);
if ( (numconfs= LP_numconfirms(coin->symbol,coin->smartaddr,txid,vout,0)) <= 0 )
{
printf("skip numconfs.%d %s.v%d\n",numconfs,bits256_str(str,txid),vout);
//printf("skip numconfs.%d %s.v%d\n",numconfs,bits256_str(str,txid),vout);
continue;
}
}
LP_address_utxoadd(1,now,"withdraw",coin,coin->smartaddr,txid,vout,value,height,-1);
if ( (up= LP_address_utxofind(coin,coin->smartaddr,txid,vout)) == 0 )
{
printf("couldnt find just added %s/%d ht.%d %.8f\n",bits256_str(str,txid),vout,height,dstr(value));
//printf("couldnt find just added %s/%d ht.%d %.8f\n",bits256_str(str,txid),vout,height,dstr(value));
}
else
{

Loading…
Cancel
Save