From 344052d69e1b011eeb53f842f347a111315bb6bc Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 24 May 2016 00:47:41 -0500 Subject: [PATCH] test --- iguana/swaps/iguana_BTCswap.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/iguana/swaps/iguana_BTCswap.c b/iguana/swaps/iguana_BTCswap.c index 816b20d5e..64f7a1a1b 100755 --- a/iguana/swaps/iguana_BTCswap.c +++ b/iguana/swaps/iguana_BTCswap.c @@ -589,8 +589,8 @@ void instantdex_swapbits256update(bits256 *txidp,cJSON *argjson,char *fieldname) void instantdex_newjson(struct supernet_info *myinfo,struct bitcoin_swapinfo *swap,cJSON *newjson) { - uint8_t pubkey[33]; int32_t deckflag; - deckflag = (newjson != 0 && swap->otherchoosei < 0) ? 1 : 0; + uint8_t pubkey[33]; int32_t deckflag = 1; + //deckflag = (newjson != 0 && swap->otherchoosei < 0) ? 1 : 0; if ( instantdex_pubkeyargs(myinfo,swap,2 + deckflag*INSTANTDEX_DECKSIZE,myinfo->persistent_priv,swap->myorderhash,0x02+instantdex_isbob(swap)) != 2 + deckflag*INSTANTDEX_DECKSIZE ) printf("ERROR: couldnt generate pubkeys deckflag.%d\n",deckflag); jaddnum(newjson,"have",swap->havestate); @@ -1262,6 +1262,11 @@ char *instantdex_statemachine(struct instantdex_stateinfo *states,int32_t numsta instantdex_newjson(myinfo,swap,newjson); printf("i.%d (%s) %s %s.%d -> %s.%d send.(%s) %p\n",i,jprint(newjson,0),cmdstr,swap->state->name,state->ind,states[state->events[i].nextstateind].name,state->events[i].nextstateind,state->events[i].sendcmd,&states[state->events[i].nextstateind]); swap->state = &states[state->events[i].nextstateind]; + if ( swap->otherchoosei < 0 ) + { + serdata = (void *)swap->deck; + serdatalen = (int32_t)sizeof(swap->deck); + } return(instantdex_sendcmd(myinfo,&swap->mine.offer,newjson,state->events[i].sendcmd,swap->othertrader,INSTANTDEX_HOPS,serdata,serdatalen,0)); } else return(clonestr("{\"error\":\"instantdex_statemachine: illegal state\"}")); } else return(clonestr("{\"result\":\"instantdex_statemachine: processed\"}"));