Browse Source

test

release/v0.1
jl777 9 years ago
parent
commit
f5d58f9488
  1. 2
      iguana/exchanges777.h
  2. 2
      iguana/iguana_exchanges.c
  3. 4
      iguana/iguana_instantdex.c

2
iguana/exchanges777.h

@ -34,7 +34,7 @@
#define INSTANTDEX_BTCD "RThtXup6Zo7LZAi8kRWgjAyi1s4u6U9Cpf"
#define INSTANTDEX_MINPERC 50.
#define INSTANTDEX_OFFERDURATION 1800
#define INSTANTDEX_OFFERDURATION 300
#define INSTANTDEX_LOCKTIME 3600
#define EXCHANGES777_MINPOLLGAP 1

2
iguana/iguana_exchanges.c

@ -590,7 +590,7 @@ void iguana_statemachineupdate(struct supernet_info *myinfo,struct exchange_info
portable_mutex_lock(&exchange->mutex);
DL_FOREACH_SAFE(exchange->statemachines,swap,tmp)
{
printf("FSM.(%llu / %llu) (%s/%s) state.(%s)\n",(long long)swap->mine.orderid,(long long)swap->other.orderid,swap->mine.offer.base,swap->mine.offer.rel,swap->state->name);
//printf("FSM.(%llu / %llu) (%s/%s) state.(%s)\n",(long long)swap->mine.orderid,(long long)swap->other.orderid,swap->mine.offer.base,swap->mine.offer.rel,swap->state->name);
}
portable_mutex_unlock(&exchange->mutex);
while ( (req= queue_dequeue(&exchange->recvQ,0)) != 0 )

4
iguana/iguana_instantdex.c

@ -859,7 +859,7 @@ struct instantdex_accept *instantdex_acceptable(struct supernet_info *myinfo,str
DL_FOREACH_SAFE(exchange->offers,ap,tmp)
{
//printf("ap.%p account.%llu dir.%d\n",ap,(long long)ap->offer.account,offerdir);
if ( now > ap->offer.expiration || ap->dead != 0 )//|| A->offer.account == ap->offer.account )
if ( now > ap->offer.expiration || ap->dead != 0 || A->offer.account == ap->offer.account )
{
//printf("now.%u skip expired %u/dead.%u or my order orderid.%llu from %llu\n",now,ap->offer.expiration,ap->dead,(long long)ap->orderid,(long long)ap->offer.account);
}
@ -1194,6 +1194,7 @@ char *instantdex_checkoffer(struct supernet_info *myinfo,uint64_t *txidp,struct
{
isbob = myap->offer.myside;
swap = bitcoin_swapinit(myinfo,exchange,myap,otherap,1,argjson,isbob != 0 ? "BOB_sentoffer" : "ALICE_sentoffer");
printf("ISBOB.%d vs %d\n",isbob,instantdex_isbob(swap));
if ( swap != 0 )
{
printf("STATEMACHINEQ.(%llu / %llu)\n",(long long)swap->mine.orderid,(long long)swap->other.orderid);
@ -1236,6 +1237,7 @@ char *instantdex_gotoffer(struct supernet_info *myinfo,struct exchange_info *exc
isbob = myap->offer.myside;
if ( (swap= bitcoin_swapinit(myinfo,exchange,myap,otherap,0,argjson,isbob != 0 ? "BOB_gotoffer" : "ALICE_gotoffer")) == 0 )
return(clonestr("{\"error\":\"couldnt allocate statemachine\"}"));
printf("ISBOB.%d vs %d\n",isbob,instantdex_isbob(swap));
if ( (newjson= instantdex_parseargjson(myinfo,exchange,swap,argjson,1)) == 0 )
{
printf("error parsing argjson\n");

Loading…
Cancel
Save