|
@ -876,7 +876,6 @@ void LP_bobloop(void *_swap) |
|
|
err = -2003, printf("error bobscripts deposit\n"); |
|
|
err = -2003, printf("error bobscripts deposit\n"); |
|
|
else |
|
|
else |
|
|
{ |
|
|
{ |
|
|
uint8_t error = 0; |
|
|
|
|
|
swap->bobrefund.utxovout = 0; |
|
|
swap->bobrefund.utxovout = 0; |
|
|
swap->bobrefund.utxotxid = swap->bobdeposit.I.signedtxid; |
|
|
swap->bobrefund.utxotxid = swap->bobdeposit.I.signedtxid; |
|
|
basilisk_bobdeposit_refund(swap,swap->I.putduration); |
|
|
basilisk_bobdeposit_refund(swap,swap->I.putduration); |
|
@ -886,33 +885,32 @@ void LP_bobloop(void *_swap) |
|
|
LP_unavailableset(swap->bobdeposit.utxotxid,swap->bobdeposit.utxovout,(uint32_t)time(NULL)+60,swap->I.otherhash); |
|
|
LP_unavailableset(swap->bobdeposit.utxotxid,swap->bobdeposit.utxovout,(uint32_t)time(NULL)+60,swap->I.otherhash); |
|
|
if ( LP_waitfor(swap->N.pair,swap,bobwaittimeout,LP_verify_otherfee) < 0 ) |
|
|
if ( LP_waitfor(swap->N.pair,swap,bobwaittimeout,LP_verify_otherfee) < 0 ) |
|
|
{ |
|
|
{ |
|
|
error = 1; |
|
|
|
|
|
err = -2004, printf("error waiting for alicefee\n"); |
|
|
err = -2004, printf("error waiting for alicefee\n"); |
|
|
} |
|
|
} |
|
|
if ( error == 0 ) |
|
|
if ( err == 0 ) |
|
|
{ |
|
|
{ |
|
|
if ( LP_swapdata_rawtxsend(swap->N.pair,swap,0x200,data,maxlen,&swap->bobdeposit,0x100,0) == 0 ) |
|
|
if ( LP_swapdata_rawtxsend(swap->N.pair,swap,0x200,data,maxlen,&swap->bobdeposit,0x100,0) == 0 ) |
|
|
{ |
|
|
{ |
|
|
error = 1; |
|
|
|
|
|
err = -2005, printf("error sending bobdeposit\n"); |
|
|
err = -2005, printf("error sending bobdeposit\n"); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
if (err == 0) { |
|
|
LP_unavailableset(swap->bobpayment.utxotxid,swap->bobpayment.utxovout,(uint32_t)time(NULL)+60,swap->I.otherhash); |
|
|
LP_unavailableset(swap->bobpayment.utxotxid,swap->bobpayment.utxovout,(uint32_t)time(NULL)+60,swap->I.otherhash); |
|
|
m = swap->I.bobconfirms; |
|
|
m = swap->I.bobconfirms; |
|
|
while ( (n= LP_numconfirms(bobstr,swap->bobdeposit.I.destaddr,swap->bobdeposit.I.signedtxid,0,1)) < m ) |
|
|
while ((n = LP_numconfirms(bobstr, swap->bobdeposit.I.destaddr, swap->bobdeposit.I.signedtxid, 0, 1)) < m) { |
|
|
{ |
|
|
LP_swap_critical = (uint32_t) time(NULL); |
|
|
LP_swap_critical = (uint32_t)time(NULL); |
|
|
LP_unavailableset(swap->bobpayment.utxotxid, swap->bobpayment.utxovout, (uint32_t) time(NULL) + 60, swap->I.otherhash); |
|
|
LP_unavailableset(swap->bobpayment.utxotxid,swap->bobpayment.utxovout,(uint32_t)time(NULL)+60,swap->I.otherhash); |
|
|
char str[65]; |
|
|
char str[65];printf("%d wait for bobdeposit %s numconfs.%d %s %s\n",n,swap->bobdeposit.I.destaddr,m,bobstr,bits256_str(str,swap->bobdeposit.I.signedtxid)); |
|
|
printf("%d wait for bobdeposit %s numconfs.%d %s %s\n", n, swap->bobdeposit.I.destaddr, m, bobstr, bits256_str(str, swap->bobdeposit.I.signedtxid)); |
|
|
sleep(10); |
|
|
sleep(10); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
printf("wait for alicepayment\n"); |
|
|
printf("wait for alicepayment\n"); |
|
|
if ( error == 0 && LP_waitfor(swap->N.pair,swap,bobwaittimeout + alicewaittimeout,LP_verify_alicepayment) < 0 ) |
|
|
if (LP_waitfor(swap->N.pair, swap, bobwaittimeout + alicewaittimeout, LP_verify_alicepayment) < 0) { |
|
|
{ |
|
|
|
|
|
error = 1; |
|
|
|
|
|
err = -2006, printf("error waiting for alicepayment\n"); |
|
|
err = -2006, printf("error waiting for alicepayment\n"); |
|
|
} |
|
|
} |
|
|
if (error == 0) |
|
|
} |
|
|
|
|
|
if (err == 0) |
|
|
{ |
|
|
{ |
|
|
LP_swap_critical = (uint32_t)time(NULL); |
|
|
LP_swap_critical = (uint32_t)time(NULL); |
|
|
if ( basilisk_bobscripts_set(swap,0,1) < 0 ) |
|
|
if ( basilisk_bobscripts_set(swap,0,1) < 0 ) |
|
|