|
|
@ -244,9 +244,17 @@ bits256 basilisk_swap_privBn_extract(bits256 *bobrefundp,char *bobcoin,bits256 b |
|
|
|
return(privBn); |
|
|
|
} |
|
|
|
|
|
|
|
bits256 basilisk_swap_spendupdate(char *symbol,int32_t *sentflags,bits256 *txids,int32_t utxoind,int32_t alicespent,int32_t bobspent,int32_t vout,char *aliceaddr,char *bobaddr) |
|
|
|
bits256 basilisk_swap_spendupdate(char *symbol,char *spentaddr,int32_t *sentflags,bits256 *txids,int32_t utxoind,int32_t alicespent,int32_t bobspent,int32_t vout,char *aliceaddr,char *bobaddr) |
|
|
|
{ |
|
|
|
bits256 spendtxid,txid; char destaddr[64],str[65]; |
|
|
|
bits256 spendtxid,txid; char destaddr[64],str[65]; struct iguana_info *coin; cJSON *histobj; |
|
|
|
if ( (coin= LP_coinfind(symbol)) != 0 && coin->electrum != 0 ) |
|
|
|
{ |
|
|
|
if ( (histobj= electrum_address_gethistory(symbol,coin->electrum,&histobj,spentaddr)) != 0 ) |
|
|
|
{ |
|
|
|
printf("processed history.(%s)\n",jprint(histobj,0)); |
|
|
|
free_json(histobj); |
|
|
|
} |
|
|
|
} |
|
|
|
txid = txids[utxoind]; |
|
|
|
memset(&spendtxid,0,sizeof(spendtxid)); |
|
|
|
if ( bits256_nonz(txid) != 0 ) |
|
|
@ -788,9 +796,9 @@ cJSON *basilisk_remember(int64_t *KMDtotals,int64_t *BTCtotals,uint32_t requesti |
|
|
|
LP_rswap_checktx(&rswap,rswap.alicecoin,BASILISK_ALICEPAYMENT); |
|
|
|
LP_rswap_checktx(&rswap,rswap.bobcoin,BASILISK_BOBPAYMENT); |
|
|
|
LP_rswap_checktx(&rswap,rswap.bobcoin,BASILISK_BOBDEPOSIT); |
|
|
|
rswap.paymentspent = basilisk_swap_spendupdate(rswap.bobcoin,rswap.sentflags,rswap.txids,BASILISK_BOBPAYMENT,BASILISK_ALICESPEND,BASILISK_BOBRECLAIM,0,Adest,Bdest); |
|
|
|
rswap.Apaymentspent = basilisk_swap_spendupdate(rswap.alicecoin,rswap.sentflags,rswap.txids,BASILISK_ALICEPAYMENT,BASILISK_ALICERECLAIM,BASILISK_BOBSPEND,0,AAdest,ABdest); |
|
|
|
rswap.depositspent = basilisk_swap_spendupdate(rswap.bobcoin,rswap.sentflags,rswap.txids,BASILISK_BOBDEPOSIT,BASILISK_ALICECLAIM,BASILISK_BOBREFUND,0,Adest,Bdest); |
|
|
|
rswap.paymentspent = basilisk_swap_spendupdate(rswap.bobcoin,rswap.bobpaymentaddr,rswap.sentflags,rswap.txids,BASILISK_BOBPAYMENT,BASILISK_ALICESPEND,BASILISK_BOBRECLAIM,0,Adest,Bdest); |
|
|
|
rswap.Apaymentspent = basilisk_swap_spendupdate(rswap.alicecoin,rswap.alicepaymentaddr,rswap.sentflags,rswap.txids,BASILISK_ALICEPAYMENT,BASILISK_ALICERECLAIM,BASILISK_BOBSPEND,0,AAdest,ABdest); |
|
|
|
rswap.depositspent = basilisk_swap_spendupdate(rswap.bobcoin,rswap.bobdepositaddr,rswap.sentflags,rswap.txids,BASILISK_BOBDEPOSIT,BASILISK_ALICECLAIM,BASILISK_BOBREFUND,0,Adest,Bdest); |
|
|
|
rswap.finishedflag = basilisk_swap_isfinished(rswap.iambob,rswap.txids,rswap.sentflags,rswap.paymentspent,rswap.Apaymentspent,rswap.depositspent); |
|
|
|
if ( rswap.iambob == 0 ) |
|
|
|
{ |
|
|
|