Browse Source

Test

etomic
jl777 7 years ago
parent
commit
aaadf2ec33
  1. 8
      iguana/exchanges/LP_transaction.c
  2. 3
      iguana/exchanges/LP_zeroconf.c

8
iguana/exchanges/LP_transaction.c

@ -1231,7 +1231,7 @@ char *LP_createrawtransaction(cJSON **txobjp,int32_t *numvinsp,struct iguana_inf
ignore_cltverr = 0; ignore_cltverr = 0;
suppress_pubkeys = 1; suppress_pubkeys = 1;
scriptlen = bitcoin_standardspend(script,0,G.LP_myrmd160); scriptlen = bitcoin_pubkeyspend(script,0,G.LP_pubsecp);
numvins = LP_vins_select(ctx,coin,&total,amount,V,utxos,numutxos,suppress_pubkeys,ignore_cltverr,privkey,privkeys,vins,script,scriptlen,utxotxid,utxovout,dustcombine); numvins = LP_vins_select(ctx,coin,&total,amount,V,utxos,numutxos,suppress_pubkeys,ignore_cltverr,privkey,privkeys,vins,script,scriptlen,utxotxid,utxovout,dustcombine);
if ( numvins <= 0 || total < amount ) if ( numvins <= 0 || total < amount )
{ {
@ -1266,6 +1266,12 @@ char *LP_createrawtransaction(cJSON **txobjp,int32_t *numvinsp,struct iguana_inf
if ( addrtype == coin->pubtype ) if ( addrtype == coin->pubtype )
spendlen = bitcoin_standardspend(spendscript,0,rmd160); spendlen = bitcoin_standardspend(spendscript,0,rmd160);
else spendlen = bitcoin_p2shspend(spendscript,0,rmd160); else spendlen = bitcoin_p2shspend(spendscript,0,rmd160);
if ( i == numvouts-1 && strcmp(coinaddr,coin->smartaddr) == 0 && change != 0 )
{
printf("combine last vout %.8f with change %.8f\n",dstr(value+adjust),dstr(change));
value += change;
change = 0;
}
txobj = bitcoin_txoutput(txobj,spendscript,spendlen,value + adjust); txobj = bitcoin_txoutput(txobj,spendscript,spendlen,value + adjust);
} }
else else

3
iguana/exchanges/LP_zeroconf.c

@ -58,6 +58,9 @@ char *LP_zeroconf_deposit(struct iguana_info *coin,int32_t weeks,double amount,i
amount64 = (amount64 / 10000) * 10000 + weeki; amount64 = (amount64 / 10000) * 10000 + weeki;
jaddnum(item,BOTS_BONDADDRESS,dstr(amount64)); jaddnum(item,BOTS_BONDADDRESS,dstr(amount64));
jaddi(array,item); jaddi(array,item);
item = cJSON_CreateObject();
jaddnum(item,coin->smartaddr,0.0001);
jaddi(array,item);
jadd(argjson,"outputs",array); jadd(argjson,"outputs",array);
printf("deposit.(%s)\n",jprint(argjson,0)); printf("deposit.(%s)\n",jprint(argjson,0));
if ( (retstr= LP_withdraw(coin,argjson)) != 0 ) if ( (retstr= LP_withdraw(coin,argjson)) != 0 )

Loading…
Cancel
Save