Browse Source

test

release/v0.1
jl777 9 years ago
parent
commit
25bff23dbb
  1. 2
      iguana/iguana_exchanges.c
  2. 5
      iguana/iguana_instantdex.c
  3. 2
      iguana/swaps/iguana_BTCswap.c

2
iguana/iguana_exchanges.c

@ -585,7 +585,7 @@ char *exchanges777_process(struct exchange_info *exchange,int32_t *retvalp,struc
void iguana_statemachineupdate(struct supernet_info *myinfo,struct exchange_info *exchange)
{
int32_t timemod,modwidth = 1; struct iguana_info *coin; struct bitcoin_swapinfo *swap,*tmp; struct iguana_bundlereq *req;
int32_t timemod,modwidth = 3; struct iguana_info *coin; struct bitcoin_swapinfo *swap,*tmp; struct iguana_bundlereq *req;
timemod = time(NULL) % modwidth;
coin = iguana_coinfind("BTCD");
portable_mutex_lock(&exchange->mutexS);

5
iguana/iguana_instantdex.c

@ -1331,7 +1331,8 @@ char *instantdex_parse(struct supernet_info *myinfo,struct instantdex_msghdr *ms
}
A.offer = *offer;
A.orderid = orderhash.txid;
printf("got.(%s) have.%x for %llx account.%llu serdatalen.%d\n",cmdstr,juint(argjson,"have"),(long long)A.orderid,(long long)A.offer.account,serdatalen);
if ( strcmp("poll",cmdstr) != 0 )
printf("got.(%s) have.%x for %llx account.%llu serdatalen.%d\n",cmdstr,juint(argjson,"have"),(long long)A.orderid,(long long)A.offer.account,serdatalen);
if ( (A.offer.minperc= jdouble(argjson,"p")) < INSTANTDEX_MINPERC )
A.offer.minperc = INSTANTDEX_MINPERC;
else if ( A.offer.minperc > 100 )
@ -1384,7 +1385,7 @@ char *instantdex_parse(struct supernet_info *myinfo,struct instantdex_msghdr *ms
}
else
{
printf("cant find existing order.%llx that matches\n",(long long)A.orderid);
//printf("cant find existing order.%llx that matches\n",(long long)A.orderid);
return(clonestr("{\"error\":\"cant find matching order\"}"));
}
}

2
iguana/swaps/iguana_BTCswap.c

@ -1260,7 +1260,7 @@ char *instantdex_statemachine(struct instantdex_stateinfo *states,int32_t numsta
if ( state->events[i].nextstateind > 1 )
{
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]);
//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];
return(instantdex_sendcmd(myinfo,&swap->mine.offer,newjson,state->events[i].sendcmd,swap->othertrader,INSTANTDEX_HOPS,serdata,serdatalen,0,swap));
} else return(clonestr("{\"error\":\"instantdex_statemachine: illegal state\"}"));

Loading…
Cancel
Save