From e086f6e4ac98ed114e1b65562b3fa184301f1e86 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 3 Dec 2017 21:57:59 +0400 Subject: [PATCH] Test --- iguana/exchanges/LP_include.h | 1 + iguana/exchanges/LP_instantdex.c | 10 ++++++---- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/iguana/exchanges/LP_include.h b/iguana/exchanges/LP_include.h index 1e9900d61..fe6637eea 100644 --- a/iguana/exchanges/LP_include.h +++ b/iguana/exchanges/LP_include.h @@ -106,6 +106,7 @@ void emscripten_usleep(int32_t x); // returns immediate, no sense for sleeping #define INSTANTDEX_KMD "RThtXup6Zo7LZAi8kRWgjAyi1s4u6U9Cpf" #define BOTS_BONDADDRESS "RNdqHx26GWy9bk8MtmH1UiXjQcXE4RKK2P" #define BOTS_BONDPUBKEY33 "03e641d22e1ff5a7d45c8880537e0b0a114d7b9fee2c18a6b4a8a80b6285292990" +#define LP_WEEKMULTBAD (7 * 24 * 2600) #define LP_WEEKMULT (7 * 24 * 3600) #define LP_FIRSTWEEKTIME 1510790400 // must be 0 mod LP_WEEKMULT diff --git a/iguana/exchanges/LP_instantdex.c b/iguana/exchanges/LP_instantdex.c index b0e24cf53..acb195e7b 100644 --- a/iguana/exchanges/LP_instantdex.c +++ b/iguana/exchanges/LP_instantdex.c @@ -219,12 +219,15 @@ int32_t LP_claim_submit(void *ctx,cJSON *txids,int64_t *sump,struct iguana_info vout1 = jitem(vouts,1); weeksatoshis = LP_value_extract(vout1,0); weeki = (int32_t)(weeksatoshis % 10000); - for (j=28; j<=28; j++) + for (j=0; j<2*168; j++) { - expiration = ((weeki * LP_WEEKMULT + j*3600) + LP_FIRSTWEEKTIME); + if ( j >= 168 ) + expiration = ((weeki * LP_WEEKMULT + (j-168)*2600) + LP_FIRSTWEEKTIME); + else expiration = ((weeki * LP_WEEKMULT + j*3600) + LP_FIRSTWEEKTIME); redeemlen = LP_deposit_addr(checkaddr,redeemscript,coin->taddr,coin->p2shtype,expiration,G.LP_pubsecp); if ( strcmp(checkaddr,vinaddr) == 0 ) { + flagi = 1; claimtime = (uint32_t)time(NULL)-777; item = cJSON_CreateObject(); jaddbits256(item,"txid",utxotxid); @@ -245,12 +248,11 @@ int32_t LP_claim_submit(void *ctx,cJSON *txids,int64_t *sump,struct iguana_info *sump += LP_claimtx(ctx,coin,&claimtxid,utxotxid,utxovout,satoshis,vinaddr,claimtime,redeemscript,redeemlen); if ( bits256_nonz(claimtxid) != 0 ) { - flagi = 1; jaddbits256(item,"claimtxid",claimtxid); jaddi(txids,item); } } - } else printf("expiration.%u j.%d checkaddr.(%s) != vinaddr.%s\n",expiration,j,checkaddr,vinaddr); + } //else printf("expiration.%u j.%d checkaddr.(%s) != vinaddr.%s\n",expiration,j,checkaddr,vinaddr); if ( flagi != 0 ) break; }