Browse Source

Fix electrum swap completion

dev
jl777 7 years ago
parent
commit
a2a7736f61
  1. 4
      iguana/exchanges/LP_remember.c
  2. 7
      iguana/exchanges/LP_swap.c

4
iguana/exchanges/LP_remember.c

@ -935,7 +935,7 @@ cJSON *basilisk_remember(int64_t *KMDtotals,int64_t *BTCtotals,uint32_t requesti
jaddnum(retjson,"quoteid",quoteid);
return(retjson);
}
if ( alice->lastscanht < alice->longestchain+1 )
if ( alice->electrum == 0 && alice->lastscanht < alice->longestchain+1 )
{
printf("need to scan %s first\n",alice->symbol);
cJSON *retjson = cJSON_CreateObject();
@ -971,7 +971,7 @@ cJSON *basilisk_remember(int64_t *KMDtotals,int64_t *BTCtotals,uint32_t requesti
jaddnum(retjson,"quoteid",quoteid);
return(retjson);
}
if ( bob->lastscanht < bob->longestchain+1 )
if ( bob->electrum == 0 && bob->lastscanht < bob->longestchain+1 )
{
printf("need to scan %s first\n",bob->symbol);
cJSON *retjson = cJSON_CreateObject();

7
iguana/exchanges/LP_swap.c

@ -1142,11 +1142,8 @@ struct basilisk_swap *bitcoin_swapinit(bits256 privkey,uint8_t *pubkey33,bits256
swap->I.bobconfirms = swap->I.bobmaxconfirms;
if ( swap->I.aliceconfirms > swap->I.alicemaxconfirms )
swap->I.aliceconfirms = swap->I.alicemaxconfirms;
if ( strcmp("BAY",swap->I.req.src) != 0 && strcmp("BAY",swap->I.req.dest) != 0 )
{
swap->I.bobconfirms *= !swap->I.bobistrusted;
swap->I.aliceconfirms *= !swap->I.aliceistrusted;
}
swap->I.bobconfirms *= !swap->I.bobistrusted;
swap->I.aliceconfirms *= !swap->I.aliceistrusted;
printf(">>>>>>>>>> jumblrflag.%d <<<<<<<<< r.%u q.%u, %.8f bobconfs.%d, %.8f aliceconfs.%d taddr.%d %d\n",jumblrflag,swap->I.req.requestid,swap->I.req.quoteid,dstr(swap->I.bobsatoshis),swap->I.bobconfirms,dstr(swap->I.alicesatoshis),swap->I.aliceconfirms,bobcoin->taddr,alicecoin->taddr);
if ( swap->I.iambob != 0 )
{

Loading…
Cancel
Save