Browse Source

Test

etomic
jl777 7 years ago
parent
commit
59f86d4237
  1. 5
      iguana/exchanges/LP_remember.c
  2. 6
      iguana/exchanges/LP_transaction.c

5
iguana/exchanges/LP_remember.c

@ -264,6 +264,7 @@ bits256 basilisk_swap_spendupdate(char *symbol,char *spentaddr,int32_t *sentflag
if ( bits256_nonz(spendtxid) != 0 )
{
sentflags[utxoind] = 1;
printf("utxoind.%d Alice.(%s) Bob.(%s)\n",utxoind,aliceaddr,bobaddr);
if ( aliceaddr != 0 && strcmp(destaddr,aliceaddr) == 0 )
{
printf("ALICE spent.(%s) -> %s\n",bits256_str(str,txid),destaddr);
@ -1089,10 +1090,10 @@ char *basilisk_swaplist(uint32_t origrequestid,uint32_t origquoteid)
array = cJSON_CreateArray();
if ( origrequestid != 0 && origquoteid != 0 )
{
printf("orig req.%u q.%u\n",origrequestid,origquoteid);
//printf("orig req.%u q.%u\n",origrequestid,origquoteid);
if ( (item= basilisk_remember(KMDtotals,BTCtotals,origrequestid,origquoteid)) != 0 )
jaddi(array,item);
printf("got.(%s)\n",jprint(item,0));
//printf("got.(%s)\n",jprint(item,0));
}
else
{

6
iguana/exchanges/LP_transaction.c

@ -560,7 +560,7 @@ int32_t iguana_signrawtransaction(void *ctx,char *symbol,uint8_t wiftaddr,uint8_
return(complete);
}
char *basilisk_swap_bobtxspend(bits256 *signedtxidp,uint64_t txfee,char *name,char *symbol,uint8_t wiftaddr,uint8_t taddr,uint8_t pubtype,uint8_t p2shtype,uint8_t isPoS,uint8_t wiftype,void *ctx,bits256 privkey,bits256 *privkey2p,uint8_t *redeemscript,int32_t redeemlen,uint8_t *userdata,int32_t userdatalen,bits256 utxotxid,int32_t vout,char *destaddr,uint8_t *pubkey33,int32_t finalseqid,uint32_t expiration,int64_t *destamountp,uint64_t satoshis,char *changeaddr,char *vinaddr,int32_t suppress_pubkeys)
char *basilisk_swap_bobtxspend(bits256 *signedtxidp,uint64_t txfee,char *name,char *symbol,uint8_t wiftaddr,uint8_t taddr,uint8_t pubtype,uint8_t p2shtype,uint8_t isPoS,uint8_t wiftype,void *ctx,bits256 privkey,bits256 *privkey2p,uint8_t *redeemscript,int32_t redeemlen,uint8_t *userdata,int32_t userdatalen,bits256 utxotxid,int32_t utxovout,char *destaddr,uint8_t *pubkey33,int32_t finalseqid,uint32_t expiration,int64_t *destamountp,uint64_t satoshis,char *changeaddr,char *vinaddr,int32_t suppress_pubkeys)
{
char *rawtxbytes=0,*signedtx=0,str[65],tmpaddr[64],hexstr[999],wifstr[128],_destaddr[64]; uint8_t spendscript[512],addrtype,rmd160[20]; cJSON *txobj,*vins,*obj,*vouts,*item,*privkeys; int32_t completed,spendlen,n,ignore_cltverr=1; struct vin_info V[2]; uint32_t timestamp,locktime = 0,sequenceid = 0xffffffff * finalseqid; bits256 txid; uint64_t value=0,change = 0; struct iguana_msgtx msgtx; struct iguana_info *coin;
if ( txfee > 0 && txfee < 10000 )
@ -578,9 +578,9 @@ char *basilisk_swap_bobtxspend(bits256 *signedtxidp,uint64_t txfee,char *name,ch
{
if ( (txobj= LP_gettx(symbol,utxotxid)) != 0 )
{
if ( (vouts= jarray(&n,txobj,"vout")) != 0 && vout < n )
if ( (vouts= jarray(&n,txobj,"vout")) != 0 && utxovout < n )
{
obj = jitem(vouts,vout);
obj = jitem(vouts,utxovout);
value = LP_value_extract(obj,1);
//printf("value in vout.%d %.8f (%s)\n",vout,dstr(value),jprint(txobj,0));
}

Loading…
Cancel
Save