|
|
@ -1494,6 +1494,7 @@ void basilisk_alicepayment(struct basilisk_swap *swap,struct iguana_info *coin,s |
|
|
|
int32_t basilisk_alicetxs(int32_t pairsock,struct basilisk_swap *swap,uint8_t *data,int32_t maxlen) |
|
|
|
{ |
|
|
|
char coinaddr[64]; int32_t i,retval = -1; |
|
|
|
printf("alicetx\n"); |
|
|
|
if ( swap->alicepayment.I.datalen == 0 ) |
|
|
|
basilisk_alicepayment(swap,swap->alicepayment.coin,&swap->alicepayment,swap->I.pubAm,swap->I.pubBn); |
|
|
|
if ( swap->alicepayment.I.datalen == 0 || swap->alicepayment.I.spendlen == 0 ) |
|
|
@ -1513,16 +1514,17 @@ int32_t basilisk_alicetxs(int32_t pairsock,struct basilisk_swap *swap,uint8_t *d |
|
|
|
} |
|
|
|
if ( swap->myfee.I.datalen == 0 ) |
|
|
|
{ |
|
|
|
//printf("generate fee\n");
|
|
|
|
printf("generate fee\n"); |
|
|
|
bitcoin_address(coinaddr,swap->alicecoin.pubtype,swap->changermd160,20); |
|
|
|
if ( basilisk_rawtx_gen(swap->ctx,"myfee",swap->I.started,swap->persistent_pubkey33,swap->I.iambob,1,&swap->myfee,0,swap->myfee.spendscript,swap->myfee.I.spendlen,swap->myfee.coin->txfee,1,0,swap->persistent_privkey,swap->changermd160,coinaddr) == 0 ) |
|
|
|
{ |
|
|
|
printf("rawtxsend\n"); |
|
|
|
swap->I.statebits |= LP_swapdata_rawtxsend(pairsock,swap,0x80,data,maxlen,&swap->myfee,0x40,0); |
|
|
|
LP_unspents_mark(swap->I.iambob!=0?swap->bobcoin.symbol:swap->alicecoin.symbol,swap->myfee.vins); |
|
|
|
//basilisk_txlog(swap,&swap->myfee,-1);
|
|
|
|
//for (i=0; i<swap->myfee.I.datalen; i++)
|
|
|
|
// printf("%02x",swap->myfee.txbytes[i]);
|
|
|
|
//printf(" <- fee state.%x\n",swap->I.statebits);
|
|
|
|
for (i=0; i<swap->myfee.I.datalen; i++) |
|
|
|
printf("%02x",swap->myfee.txbytes[i]); |
|
|
|
printf(" <- fee state.%x\n",swap->I.statebits); |
|
|
|
swap->I.statebits |= 0x40; |
|
|
|
} |
|
|
|
else |
|
|
|