Browse Source

test

release/v0.1
jl777 9 years ago
parent
commit
9df2c68852
  1. 8
      iguana/iguana_instantdex.c
  2. 2
      iguana/swaps/iguana_BTCswap.c

8
iguana/iguana_instantdex.c

@ -954,7 +954,10 @@ char *instantdex_gotoffer(struct supernet_info *myinfo,struct exchange_info *exc
isbob = myap->offer.myside;
swap = bitcoin_swapinit(myinfo,exchange,myap,otherap,0,argjson,isbob != 0 ? "BOB_sentoffer" : "ALICE_sentoffer");
if ( (newjson= instantdex_parseargjson(myinfo,exchange,swap,argjson,1)) == 0 )
{
printf("error parsing argjson\n");
return(clonestr("{\"error\":\"instantdex_BTCswap offer null newjson\"}"));
}
else //if ( (retstr= instantdex_addfeetx(myinfo,newjson,ap,swap,"BOB_gotoffer","ALICE_gotoffer")) == 0 )
{
queue_enqueue("statemachineQ",&exchange->statemachineQ,&swap->DL,0);
@ -1019,6 +1022,11 @@ char *instantdex_parse(struct supernet_info *myinfo,struct instantdex_msghdr *ms
{
//printf("found existing state machine %llu\n",(long long)A.orderid);
newjson = instantdex_parseargjson(myinfo,exchange,swap,argjson,0);
if ( serdatalen == sizeof(swap->otherdeck) && swap->choosei < 0 && (retstr= instantdex_choosei(swap,newjson,argjson,serdata,serdatalen)) != 0 )
{
printf("error choosei\n");
return(retstr);
}
return(instantdex_statemachine(BTC_states,BTC_numstates,myinfo,exchange,swap,cmdstr,argjson,newjson,serdata,serdatalen));
}
else

2
iguana/swaps/iguana_BTCswap.c

@ -570,7 +570,7 @@ cJSON *instantdex_parseargjson(struct supernet_info *myinfo,struct exchange_info
jaddnum(newjson,"verified",swap->otherverifiedcut);
if ( instantdex_pubkeyargs(swap,newjson,2 + deckflag*INSTANTDEX_DECKSIZE,myinfo->persistent_priv,swap->myorderhash,0x02+instantdex_isbob(swap)) == 2 + deckflag*INSTANTDEX_DECKSIZE )
instantdex_getpubs(swap,argjson,newjson);
else printf("ERROR: couldnt generate pubkeys\n");
else printf("ERROR: couldnt generate pubkeys deckflag.%d\n",deckflag);
}
return(newjson);
}

Loading…
Cancel
Save