Browse Source

test

release/v0.1
jl777 9 years ago
parent
commit
a861e6bb73
  1. 43
      iguana/iguana777.c
  2. 3
      iguana/iguana_bundles.c
  3. 6
      iguana/iguana_recv.c
  4. 3
      iguana/iguana_unspents.c
  5. 2
      iguana/main.c

43
iguana/iguana777.c

@ -446,15 +446,35 @@ void iguana_helper(void *arg)
myfree(ptr,ptr->allocsize);
} else break;
}
if ( (ptr= queue_dequeue(&validateQ,0)) != 0 )
/* if ( (ptr= queue_dequeue(&convertQ,0)) != 0 )
{
if ( ptr->bp != 0 && (coin= ptr->coin) != 0 && coin->active != 0 )
flag += iguana_bundlevalidate(ptr->coin,ptr->bp);
else if ( coin->active != 0 )
printf("helper validate missing param? %p %p\n",ptr->coin,ptr->bp);
coin = ptr->coin;
if ( (bp= ptr->bp) != 0 && coin != 0 )
{
double startmillis = OS_milliseconds();
printf("start conversion.[%d]\n",bp->hdrsi);
if ( (converted= iguana_spendvectorconvs(coin,bp)) < 0 )
printf("error ram balancecalc.[%d]\n",bp->hdrsi);
else
{
n = coin->bundlescount;
for (i=m=total_tmpspends=0; i<n; i++)
{
if ( coin->bundles[i] != 0 )
{
total_tmpspends += coin->bundles[i]->numtmpspends;
if ( coin->bundles[i]->converted != 0 )
m++;
}
}
total += converted;
printf("[%4d] millis %7.3f converted.%-7d balance calc.%-4d of %4d | total.%llu of %llu\n",bp->hdrsi,OS_milliseconds()-startmillis,converted,m,n,(long long)total,(long long)total_tmpspends);
if ( m == n-1 )
iguana_spendvectorsaves(coin);
}
}
myfree(ptr,ptr->allocsize);
flag++;
}
}*/
}
if ( (type & (1 << 1)) != 0 && (ptr= queue_dequeue(&spendvectorsQ,0)) != 0 )
{
@ -481,6 +501,15 @@ void iguana_helper(void *arg)
else if ( coin->active != 0 )
printf("helper missing param? %p %p\n",coin,bp);
myfree(ptr,ptr->allocsize);
if ( (ptr= queue_dequeue(&validateQ,0)) != 0 )
{
if ( ptr->bp != 0 && (coin= ptr->coin) != 0 && coin->active != 0 )
flag += iguana_bundlevalidate(ptr->coin,ptr->bp);
else if ( coin->active != 0 )
printf("helper validate missing param? %p %p\n",ptr->coin,ptr->bp);
myfree(ptr,ptr->allocsize);
flag++;
}
}
if ( queue_size(&spendvectorsQ) != 0 || queue_size(&bundlesQ) > 10 )
allcurrent = 0;

3
iguana/iguana_bundles.c

@ -208,6 +208,7 @@ int32_t iguana_bundlehash2add(struct iguana_info *coin,struct iguana_block **blo
if ( bp->blocks[bundlei] != 0 && bp->blocks[bundlei] != block )
{
printf("bp->blocks[%d] mismatch %p != %p\n",bundlei,bp->blocks[bundlei],block);
bp->blocks[bundlei] = 0;
return(-1);
}
if ( bits256_nonz(bp->hashes[bundlei]) != 0 && bits256_cmp(bp->hashes[bundlei],block->RO.hash2) != 0 )
@ -665,7 +666,7 @@ int32_t iguana_bundlehdr(struct iguana_info *coin,struct iguana_bundle *bp,int32
bp->hdrtime = (uint32_t)time(NULL);
if ( bp == coin->current && bp->speculative != 0 )
{
//printf("iguana_bundlehdr.[%d] %d %s\n",bp->hdrsi,bp->numspec,bits256_str(str,bp->hashes[0]));
printf("iguana_bundlehdr.[%d] %d %s\n",bp->hdrsi,bp->numspec,bits256_str(str,bp->hashes[0]));
if ( iguana_blocksmissing(coin,&avail,missings,0,bp,0,7) > 0 )
iguana_bundleissuemissing(coin,bp,missings,3);
}

6
iguana/iguana_recv.c

@ -894,10 +894,10 @@ struct iguana_bundlereq *iguana_recvblockhashes(struct iguana_info *coin,struct
block->newtx = 1;
iguana_blockQ("RTblock",coin,0,-7,blockhashes[1],1); // should be RT block
}
if ( coin->enableCACHE != 0 && num >= coin->chain->bundlesize )
if ( coin->enableCACHE != 0 )//&& num >= coin->chain->bundlesize )
{
iguana_blockQ("recvhash7",coin,0,-7,blockhashes[1],1);
iguana_blockQ("recvhash7",coin,0,-7,blockhashes[coin->chain->bundlesize],1);
iguana_blockQ("recvhash7",coin,0,-7,blockhashes[num-1],1);
}
return(req);
}
@ -931,7 +931,7 @@ struct iguana_bundlereq *iguana_recvblock(struct iguana_info *coin,struct iguana
}
}
}
if ( 1 )//&& bp != 0 && bp->hdrsi == coin->bundlescount-1 )
if ( 0 )//&& bp != 0 && bp->hdrsi == coin->bundlescount-1 )
{
int32_t i; static int32_t numrecv;
numrecv++;

3
iguana/iguana_unspents.c

@ -1706,9 +1706,10 @@ int32_t iguana_spendvectorsaves(struct iguana_info *coin)
int32_t iguana_spendvectorconvs(struct iguana_info *coin,struct iguana_bundle *refbp)
{
struct iguana_bundle *bp; struct iguana_spendvector *vec; int32_t i,converted,j,n = coin->bundlescount;
iguana_ramchain_prefetch(coin,&refbp->ramchain,0);
for (i=converted=0; i<n; i++)
{
if ( coin->origbalanceswritten <= 1 && coin->spendvectorsaved == 0 && (bp= coin->bundles[i]) != 0 && bp->tmpspends != 0 && bp->numtmpspends > 0 )
if ( (bp= coin->bundles[i]) != 0 && bp->tmpspends != 0 && bp->numtmpspends > 0 )
{
for (j=0; j<bp->numtmpspends; j++)
{

2
iguana/main.c

@ -1185,7 +1185,7 @@ void iguana_main(void *arg)
if ( 1 )
{
sleep(1);
if ( 1 && (str= SuperNET_JSON(myinfo,cJSON_Parse("{\"VALIDATE\":1,\"prefetchlag\":13,\"startpend\":512,\"endpend\":512,\"userhome\":\"/Users/jimbolaptop/Library/Application Support\",\"agent\":\"iguana\",\"method\":\"addcoin\",\"services\":128,\"maxpeers\":256,\"newcoin\":\"BTCD\",\"active\":1,\"numhelpers\":8,\"poll\":1}"),0,myinfo->rpcport)) != 0 )
if ( 1 && (str= SuperNET_JSON(myinfo,cJSON_Parse("{\"VALIDATE\":1,\"prefetchlag\":13,\"startpend\":512,\"endpend\":512,\"userhome\":\"/Users/jimbolaptop/Library/Application Support\",\"agent\":\"iguana\",\"method\":\"addcoin\",\"services\":129,\"maxpeers\":256,\"newcoin\":\"BTCD\",\"active\":1,\"numhelpers\":8,\"poll\":1}"),0,myinfo->rpcport)) != 0 )
{
free(str);
if ( 0 && (str= SuperNET_JSON(myinfo,cJSON_Parse("{\"userhome\":\"/Users/jimbolaptop/Library/Application Support\",\"agent\":\"iguana\",\"method\":\"addcoin\",\"services\":1024,\"maxpeers\":256,\"newcoin\":\"BTCD\",\"active\":1}"),0,myinfo->rpcport)) != 0 )

Loading…
Cancel
Save