Browse Source

test

release/v0.1
jl777 9 years ago
parent
commit
137b93fc62
  1. 7
      iguana/swaps/iguana_BTCswap.c

7
iguana/swaps/iguana_BTCswap.c

@ -709,7 +709,7 @@ cJSON *instantdex_parseargjson(struct supernet_info *myinfo,struct exchange_info
swap->otherverifiedcut = 1; swap->otherverifiedcut = 1;
if ( juint(argjson,"have") != 0 ) if ( juint(argjson,"have") != 0 )
swap->otherhavestate |= juint(argjson,"have"); swap->otherhavestate |= juint(argjson,"have");
printf("got other.%x myhave.%x choosei.(%d %d)\n",swap->otherhavestate,swap->havestate,swap->choosei,swap->otherchoosei); //printf("got other.%x myhave.%x choosei.(%d %d)\n",swap->otherhavestate,swap->havestate,swap->choosei,swap->otherchoosei);
} }
return(newjson); return(newjson);
} }
@ -915,6 +915,7 @@ cJSON *BTC_waitdepositfunc(struct supernet_info *myinfo,struct exchange_info *ex
cJSON *BTC_waitaltpaymentfunc(struct supernet_info *myinfo,struct exchange_info *exchange,struct bitcoin_swapinfo *swap,cJSON *argjson,cJSON *newjson,uint8_t **serdatap,int32_t *serdatalenp) cJSON *BTC_waitaltpaymentfunc(struct supernet_info *myinfo,struct exchange_info *exchange,struct bitcoin_swapinfo *swap,cJSON *argjson,cJSON *newjson,uint8_t **serdatap,int32_t *serdatalenp)
{ {
char *retstr; struct iguana_info *coinbtc = iguana_coinfind("BTC");
*serdatap = 0, *serdatalenp = 0; *serdatap = 0, *serdatalenp = 0;
if ( swap->altpayment != 0 ) if ( swap->altpayment != 0 )
{ {
@ -922,7 +923,11 @@ cJSON *BTC_waitaltpaymentfunc(struct supernet_info *myinfo,struct exchange_info
{ {
strcmp(swap->expectedcmdstr,"BTCalttx"); strcmp(swap->expectedcmdstr,"BTCalttx");
if ( instantdex_altpaymentverify(myinfo,iguana_coinfind(swap->mine.offer.base),swap,argjson) == 0 ) if ( instantdex_altpaymentverify(myinfo,iguana_coinfind(swap->mine.offer.base),swap,argjson) == 0 )
{
if ( swap->payment != 0 || (swap->payment= instantdex_bobtx(myinfo,swap,coinbtc,swap->mypubs[1],swap->otherpubs[0],swap->privkeys[swap->otherchoosei],swap->reftime,swap->BTCsatoshis,0)) != 0 )
free(retstr);
jaddstr(newjson,"virtevent","altfound"); jaddstr(newjson,"virtevent","altfound");
}
} else jaddstr(newjson,"virtevent","altfound"); } else jaddstr(newjson,"virtevent","altfound");
} }
return(newjson); return(newjson);

Loading…
Cancel
Save