Browse Source

Test

etomic
jl777 7 years ago
parent
commit
e086f6e4ac
  1. 1
      iguana/exchanges/LP_include.h
  2. 10
      iguana/exchanges/LP_instantdex.c

1
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

10
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;
}

Loading…
Cancel
Save