|
|
@ -850,7 +850,6 @@ char *basilisk_swap_bobtxspend(bits256 *signedtxidp,uint64_t txfee,char *name,ch |
|
|
|
jaddbits256(item,"txid",utxotxid); |
|
|
|
jaddnum(item,"vout",utxovout); |
|
|
|
bitcoin_address(symbol,tmpaddr,taddr,pubtype,pubkey33,33); |
|
|
|
printf("%s tmpaddr.%s\n",symbol,tmpaddr); |
|
|
|
bitcoin_addr2rmd160(symbol,taddr,&addrtype,rmd160,tmpaddr); |
|
|
|
if ( redeemlen != 0 ) |
|
|
|
{ |
|
|
@ -859,7 +858,7 @@ char *basilisk_swap_bobtxspend(bits256 *signedtxidp,uint64_t txfee,char *name,ch |
|
|
|
if ( vinaddr != 0 ) |
|
|
|
bitcoin_addr2rmd160(symbol,taddr,&addrtype,rmd160,vinaddr); |
|
|
|
spendlen = bitcoin_p2shspend(spendscript,0,rmd160); |
|
|
|
printf("P2SH path.%s\n",vinaddr!=0?vinaddr:0); |
|
|
|
//printf("P2SH path.%s\n",vinaddr!=0?vinaddr:0);
|
|
|
|
} else spendlen = bitcoin_standardspend(spendscript,0,rmd160); |
|
|
|
init_hexbytes_noT(hexstr,spendscript,spendlen); |
|
|
|
jaddstr(item,"scriptPubKey",hexstr); |
|
|
@ -868,7 +867,6 @@ char *basilisk_swap_bobtxspend(bits256 *signedtxidp,uint64_t txfee,char *name,ch |
|
|
|
jaddi(vins,item); |
|
|
|
jdelete(txobj,"vin"); |
|
|
|
jadd(txobj,"vin",vins); |
|
|
|
printf("destaddrs %s\n",symbol); |
|
|
|
if ( destaddr == 0 ) |
|
|
|
{ |
|
|
|
destaddr = _destaddr; |
|
|
@ -892,14 +890,12 @@ char *basilisk_swap_bobtxspend(bits256 *signedtxidp,uint64_t txfee,char *name,ch |
|
|
|
changelen = bitcoin_standardspend(changescript,0,changermd160); |
|
|
|
txobj = bitcoin_txoutput(txobj,changescript,changelen,change); |
|
|
|
} |
|
|
|
printf("bitcoin_json2hex %s\n",symbol); |
|
|
|
if ( (rawtxbytes= bitcoin_json2hex(symbol,isPoS,&txid,txobj,V)) != 0 ) |
|
|
|
{ |
|
|
|
char str[65]; |
|
|
|
completed = 0; |
|
|
|
memset(signedtxidp,0,sizeof(*signedtxidp)); |
|
|
|
//printf("locktime.%u sequenceid.%x rawtx.(%s) vins.(%s)\n",locktime,sequenceid,rawtxbytes,jprint(vins,0));
|
|
|
|
printf("iguana_signrawtransaction %s\n",symbol); |
|
|
|
if ( (completed= iguana_signrawtransaction(ctx,symbol,wiftaddr,taddr,pubtype,p2shtype,isPoS,1000000,&msgtx,&signedtx,signedtxidp,V,1,rawtxbytes,vins,privkeys,zcash)) < 0 ) |
|
|
|
//if ( (signedtx= LP_signrawtx(symbol,signedtxidp,&completed,vins,rawtxbytes,privkeys,V)) == 0 )
|
|
|
|
printf("couldnt sign transaction.%s %s\n",name,bits256_str(str,*signedtxidp)); |
|
|
|