Browse Source

test

release/v0.1
jl777 9 years ago
parent
commit
3b675d14f0
  1. 4
      iguana/exchanges777.h
  2. 5
      iguana/iguana_instantdex.c
  3. 3
      iguana/swaps/iguana_BTCswap.c

4
iguana/exchanges777.h

@ -24,7 +24,7 @@
#define INSTANTDEX_DECKSIZE 777
#define INSTANTDEX_HOPS 2
#define INSTANTDEX_DURATION 60
#define INSTANTDEX_DURATION 30
#define INSTANTDEX_ORDERSTATE_IDLE 0
#define INSTANTDEX_ORDERSTATE_HAVEOTHERFEE 1
@ -41,7 +41,7 @@
#define INSTANTDEX_BTCD "RThtXup6Zo7LZAi8kRWgjAyi1s4u6U9Cpf"
#define INSTANTDEX_MINPERC 50
#define INSTANTDEX_OFFERDURATION 30
#define INSTANTDEX_OFFERDURATION 60
#define INSTANTDEX_LOCKTIME 3600
#define EXCHANGES777_MINPOLLGAP 1

5
iguana/iguana_instantdex.c

@ -1283,7 +1283,10 @@ char *instantdex_gotoffer(struct supernet_info *myinfo,struct exchange_info *exc
if ( strcmp(myap->offer.rel,"BTC") != 0 )
return(clonestr("{\"error\":\"instantdex_BTCswap offer non BTC rel\"}"));
if ( myap->offer.expiration < (time(NULL) + INSTANTDEX_DURATION) || otherap->offer.expiration < (time(NULL) + INSTANTDEX_DURATION) )
{
printf("too close to expiration: %u >= %lu\n",otherap->offer.expiration,(time(NULL) + INSTANTDEX_DURATION));
return(clonestr("{\"error\":\"instantdex_BTCswap offer too close to expiration\"}"));
}
isbob = myap->offer.myside;
swap = bitcoin_swapinit(myinfo,exchange,myap,otherap,0,argjson,"BTC_waitdeck");
if ( swap == 0 )
@ -1346,7 +1349,7 @@ char *instantdex_parse(struct supernet_info *myinfo,struct instantdex_msghdr *ms
{
if ( signerbits == swap->othertrader.txid )
{
swap->expiration += INSTANTDEX_DURATION;
swap->expiration += INSTANTDEX_OFFERDURATION;
printf("OTHER SIDE sent packet\n");
}
if ( swap->cutverified == 0 && swap->choosei >= 0 && serdatalen == sizeof(swap->privkeys) )

3
iguana/swaps/iguana_BTCswap.c

@ -1326,7 +1326,10 @@ char *instantdex_BTCswap(struct supernet_info *myinfo,struct exchange_info *exch
if ( strcmp(cmdstr,"offer") == 0 ) // sender is Bob, receiver is network (Alice)
{
if ( A->offer.expiration < (time(NULL) + INSTANTDEX_DURATION) )
{
printf("too close to expiration: %u >= %lu\n",A->offer.expiration,(time(NULL) + INSTANTDEX_DURATION));
return(clonestr("{\"error\":\"instantdex_BTCswap offer too close to expiration\"}"));
}
if ( (ap= instantdex_acceptable(exchange,A,myinfo->myaddr.nxt64bits)) != 0 )
{
isbob = 0;

Loading…
Cancel
Save