Browse Source

test

etomic
jl777 8 years ago
parent
commit
c8e4c46543
  1. 2
      iguana/iguana777.c
  2. 10
      iguana/iguana_blocks.c
  3. 2
      iguana/iguana_msg.c
  4. 2
      iguana/iguana_realtime.c
  5. 2
      iguana/iguana_recv.c
  6. 2
      iguana/tests/LPinit
  7. 2
      iguana/tests/LPinit0

2
iguana/iguana777.c

@ -1128,7 +1128,7 @@ struct iguana_info *iguana_setcoin(char *symbol,void *launched,int32_t maxpeers,
if ( coin->MAXMEM == 0 )
coin->MAXMEM = IGUANA_DEFAULTRAM;
coin->MAXMEM *= (1024L * 1024 * 1024);
coin->enableCACHE = 0;//(strcmp("BTC",coin->symbol) != 0);
coin->enableCACHE = 0;//(strcmp("BTCD",coin->symbol) == 0);
if ( jobj(json,"cache") != 0 )
coin->enableCACHE = juint(json,"cache");
if ( (coin->polltimeout= juint(json,"poll")) <= 0 )

10
iguana/iguana_blocks.c

@ -349,14 +349,14 @@ void iguana_blockzcopy(uint8_t zcash,struct iguana_block *dest,struct iguana_blo
int32_t iguana_blockvalidate(struct supernet_info *myinfo,struct iguana_info *coin,int32_t *validp,struct iguana_block *block,int32_t dispflag)
{
bits256 hash2; uint8_t serialized[sizeof(struct iguana_msgblock) + 4096];
bits256 hash2; int32_t len; uint8_t serialized[sizeof(struct iguana_msgblock) + 32768];
if ( coin->chain->debug != 0 || coin->chain->zcash != 0 )
{
*validp = 1;
return(0);
}
*validp = 0;
if ( iguana_serialize_block(myinfo,coin->chain,&hash2,serialized,block) < 0 )
if ( (len= iguana_serialize_block(myinfo,coin->chain,&hash2,serialized,block)) < 0 )
return(-1);
*validp = (memcmp(hash2.bytes,block->RO.hash2.bytes,sizeof(hash2)) == 0);
block->valid = *validp;
@ -367,8 +367,10 @@ int32_t iguana_blockvalidate(struct supernet_info *myinfo,struct iguana_info *co
if ( dispflag != 0 )
{
static uint32_t counter;
if ( (counter++ % 10000) == 9999 )
printf("iguana_blockvalidate.%d: %s miscompare.%d (%s) vs (%s)\n",block->height,coin->symbol,counter,bits256_str(str,hash2),bits256_str(str2,block->RO.hash2));
//for (i=0; i<len; i++)
// printf("%02x",serialized[i]);
if ( (counter++ % 100) == 99 )
printf(" iguana_blockvalidate.%d: %s miscompare.%d (%s) vs (%s)\n",block->height,coin->symbol,counter,bits256_str(str,hash2),bits256_str(str2,block->RO.hash2));
//getchar();
}
return(-1);

2
iguana/iguana_msg.c

@ -242,7 +242,7 @@ int32_t iguana_serialize_block(struct supernet_info *myinfo,struct iguana_chain
msg->H.bits = block->RO.bits;
msg->H.nonce = block->RO.nonce;
msg->txn_count = block->RO.txn_count;
len = iguana_rwblock(myinfo,chain->symbol,chain->zcash,chain->auxpow,chain->hashalgo,1,hash2p,serialized,&zmsg,IGUANA_MAXPACKETSIZE);
len = iguana_rwblock(myinfo,chain->symbol,chain->zcash,chain->auxpow,chain->hashalgo,1,hash2p,serialized,(void *)msg,IGUANA_MAXPACKETSIZE);
}
else
{

2
iguana/iguana_realtime.c

@ -717,7 +717,7 @@ int32_t iguana_RTiterate(struct supernet_info *myinfo,struct iguana_info *coin,i
if ( block->height > coin->maxRTheight )
{
coin->maxRTheight = block->height;
printf("%s %.8f [%.8f %.8f] RTiterate.%lld %d tx.%d len.%d %s\n",coin->symbol,dstr(coin->histbalance)+dstr(coin->RTcredits)-dstr(coin->RTdebits),dstr(coin->RTcredits),dstr(coin->RTdebits),(long long)polarity,offset,coin->RTnumtx[offset],coin->RTrecvlens[offset],bits256_str(str,block->RO.hash2));
printf("%s.%d %.8f [%.8f %.8f] RTiterate.%lld %d tx.%d len.%d %s\n",coin->symbol,block->height,dstr(coin->histbalance)+dstr(coin->RTcredits)-dstr(coin->RTdebits),dstr(coin->RTcredits),dstr(coin->RTdebits),(long long)polarity,offset,coin->RTnumtx[offset],coin->RTrecvlens[offset],bits256_str(str,block->RO.hash2));
}
if ( coin->RTrawmem.ptr == 0 )
iguana_meminit(&coin->RTrawmem,"RTrawmem",0,IGUANA_MAXPACKETSIZE * 2,0);

2
iguana/iguana_recv.c

@ -823,7 +823,7 @@ void iguana_gotblockM(struct supernet_info *myinfo,struct iguana_info *coin,stru
block->bundlei = bundlei;
block->height = bp->hdrsi*coin->chain->bundlesize + bundlei;
block->txvalid = block->valid = 1;
block->RO.txn_count = origtxdata->zblock.RO.txn_count;
block->RO = origtxdata->zblock.RO;
if ( block->fpipbits != 0 && block->fpos >= 0 )
{
static int32_t numredundant; static double redundantsize; static uint32_t lastdisp;

2
iguana/tests/LPinit

@ -1,2 +1,2 @@
#!/bin/bash
curl --url "http://127.0.0.1:7778" --data "{\"agent\":\"tradebot\",\"method\":\"liquidity\",\"targetcoin\":\"BTCD\",\"vals\":{\"profit\":0.01}}"
curl --url "http://127.0.0.1:7778" --data "{\"agent\":\"tradebot\",\"method\":\"liquidity\",\"targetcoin\":\"KMD\",\"vals\":{\"profit\":0.01}}"

2
iguana/tests/LPinit0

@ -0,0 +1,2 @@
#!/bin/bash
curl --url "http://127.0.0.1:7778" --data "{\"agent\":\"tradebot\",\"method\":\"liquidity\",\"targetcoin\":\"BTCD\",\"vals\":{\"profit\":0.01}}"
Loading…
Cancel
Save