Browse Source

test

release/v0.1
jl777 8 years ago
parent
commit
52db5687a9
  1. 11
      iguana/iguana_bundles.c
  2. 7
      iguana/iguana_unspents.c
  3. 2
      iguana/main.c
  4. 2
      includes/iguana_defines.h

11
iguana/iguana_bundles.c

@ -219,9 +219,16 @@ int32_t iguana_bundlehash2add(struct iguana_info *coin,struct iguana_block **blo
else
{
printf("bp.[%d]->blocks[%d] mismatch %p != %p\n",bp->hdrsi,bundlei,bp->blocks[bundlei],block);
if ( coin->RTheight > 0 && bp->bundleheight+bundlei > coin->firstRTheight )
{
if ( (block= iguana_blockfind("reset",coin,bp->hashes[0])) != 0 )
{
printf("RESET HWM to %d\n",coin->firstRTheight);
iguana_blockzcopy(coin->chain->zcash,(void *)&coin->blocks.hwmchain,block);
return(-1);
}
}
iguana_blockunmark(coin,block,bp,bundlei,1);
bp->blocks[bundlei] = 0;
memset(bp->hashes[bundlei].bytes,0,sizeof(bp->hashes[bundlei]));
return(-1);
}
}

7
iguana/iguana_unspents.c

@ -1019,6 +1019,7 @@ void iguana_utxoaddr_purge(struct iguana_info *coin)
}
coin->utxoaddrs = 0;
}
memset(coin->utxoaddrhash.bytes,0,sizeof(coin->utxoaddrhash));
}
int32_t iguana_utxoaddr_save(struct iguana_info *coin,char *fname,int64_t balance,uint32_t *counts,uint32_t *offsets,uint8_t *table)
@ -1185,6 +1186,11 @@ int64_t iguana_utxoaddr_gen(struct supernet_info *myinfo,struct iguana_info *coi
}
printf("utxoaddr_gen.%d\n",maxheight);
iguana_utxoaddr_purge(coin);
HASH_ITER(hh,coin->utxoaddrs,utxoaddr,tmp)
{
checkbalance += utxoaddr->histbalance;
}
printf("balance after purge %.8f\n",dstr(checkbalance));
for (hdrsi=0; hdrsi<coin->bundlescount-1; hdrsi++)
if ( (bp= coin->bundles[hdrsi]) != 0 && bp->bundleheight < maxheight && (rdata= bp->ramchain.H.data) != 0 )
{
@ -1205,6 +1211,7 @@ int64_t iguana_utxoaddr_gen(struct supernet_info *myinfo,struct iguana_info *coi
sprintf(fname,"%s/%s/utxoaddrs",GLOBAL_DBDIR,coin->symbol), OS_portable_path(fname);
fprintf(stderr,"%d bundles for iguana_utxoaddr_gen.[%d] max.%d ht.%d\n",hdrsi,coin->utxoaddrind,coin->utxodatasize,maxheight);
counts = calloc(0x10000,sizeof(*counts));
checkbalance = 0;
HASH_ITER(hh,coin->utxoaddrs,utxoaddr,tmp)
{
if ( utxoaddr->histbalance > 0 )

2
iguana/main.c

@ -551,7 +551,7 @@ void iguana_appletests(struct supernet_info *myinfo)
bitcoin_sharedsecret(myinfo->ctx,hash2,pubkey,33);
printf("secp256k1 elapsed %.3f for %d iterations\n",OS_milliseconds() - startmillis,i);
getchar();**/
if ( 1 && (str= SuperNET_JSON(myinfo,cJSON_Parse("{\"protover\":70002,\"RELAY\":1,\"VALIDATE\":0,\"portp2p\":14631,\"rpc\":14632,\"agent\":\"iguana\",\"method\":\"addcoin\",\"startpend\":64,\"endpend\":64,\"services\":129,\"maxpeers\":64,\"newcoin\":\"BTCD\",\"active\":1,\"numhelpers\":1,\"poll\":100}"),0,myinfo->rpcport)) != 0 )
if ( 1 && (str= SuperNET_JSON(myinfo,cJSON_Parse("{\"protover\":70002,\"RELAY\":1,\"VALIDATE\":0,\"portp2p\":14631,\"rpc\":14632,\"agent\":\"iguana\",\"method\":\"addcoin\",\"startpend\":64,\"endpend\":64,\"services\":129,\"maxpeers\":256,\"newcoin\":\"BTCD\",\"active\":1,\"numhelpers\":1,\"poll\":100}"),0,myinfo->rpcport)) != 0 )
{
free(str);
if ( 0 && (str= SuperNET_JSON(myinfo,cJSON_Parse("{\"portp2p\":8333,\"RELAY\":0,\"VALIDATE\":0,\"agent\":\"iguana\",\"method\":\"addcoin\",\"startpend\":1,\"endpend\":1,\"services\":128,\"maxpeers\":8,\"newcoin\":\"BTC\",\"active\":0,\"numhelpers\":1,\"poll\":100}"),0,myinfo->rpcport)) != 0 )

2
includes/iguana_defines.h

@ -78,7 +78,7 @@ struct iguana_txdatabits { uint64_t addrind:IGUANA_LOG2MAXPEERS,filecount:10,fpo
#define IGUANA_DEDICATED_THREADS
#ifdef IGUANA_DEDICATED_THREADS
#define IGUANA_MAXCONNTHREADS 16
#define IGUANA_MAXCONNTHREADS 8
#define IGUANA_MAXSENDTHREADS (IGUANA_MAXPEERS>>2)
#define IGUANA_MAXRECVTHREADS (IGUANA_MAXPEERS>>2)
#else

Loading…
Cancel
Save