diff --git a/iguana/exchanges777.h b/iguana/exchanges777.h index 9cb0fb9f2..28dc49913 100755 --- a/iguana/exchanges777.h +++ b/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 diff --git a/iguana/iguana_instantdex.c b/iguana/iguana_instantdex.c index c825513e3..18ba69881 100755 --- a/iguana/iguana_instantdex.c +++ b/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) ) diff --git a/iguana/swaps/iguana_BTCswap.c b/iguana/swaps/iguana_BTCswap.c index edf39d25a..0627f1f6e 100755 --- a/iguana/swaps/iguana_BTCswap.c +++ b/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;