Browse Source

test

release/v0.1
jl777 9 years ago
parent
commit
31816cf849
  1. 6
      iguana/iguana_blocks.c
  2. 13
      iguana/iguana_bundles.c
  3. 1
      iguana/iguana_recv.c
  4. 2
      iguana/main.c

6
iguana/iguana_blocks.c

@ -56,11 +56,11 @@ struct iguana_block *iguana_blockhashset(struct iguana_info *coin,int32_t height
return(0);
}
depth++;
//portable_mutex_lock(&coin->blocks_mutex);
portable_mutex_lock(&coin->blocks_mutex);
HASH_FIND(hh,coin->blocks.hash,&hash2,sizeof(hash2),block);
if ( block != 0 )
{
//portable_mutex_unlock(&coin->blocks_mutex);
portable_mutex_unlock(&coin->blocks_mutex);
depth--;
return(block);
}
@ -88,7 +88,7 @@ struct iguana_block *iguana_blockhashset(struct iguana_info *coin,int32_t height
printf("%s height.%d search error %p != %p\n",str,height,block,tmp);
}
}
//portable_mutex_unlock(&coin->blocks_mutex);
portable_mutex_unlock(&coin->blocks_mutex);
depth--;
return(block);
}

13
iguana/iguana_bundles.c

@ -275,11 +275,16 @@ struct iguana_bundle *iguana_bundlecreate(struct iguana_info *coin,int32_t *bund
bits256_str(str,bundlehash2);
if ( iguana_bundlefind(coin,&bp,bundleip,bundlehash2) != 0 )
{
if ( bits256_nonz(bp->allhash) == 0 )
bp->allhash = allhash;
if ( bp->bundleheight >= 0 && bp->bundleheight != (bundleheight - *bundleip) )
{
printf("bundlecreate warning: bp->bundleheight %d != %d (bundleheight %d - %d bundlei)\n",bp->bundleheight,(bundleheight - *bundleip),bundleheight,*bundleip);
return(bp);
return(bp);
}
else if ( bits256_nonz(bp->allhash) == 0 )
{
bp->allhash = allhash;
return(bp);
}
}
bp = mycalloc('b',1,sizeof(*bp));
bp->n = coin->chain->bundlesize;
@ -295,7 +300,7 @@ struct iguana_bundle *iguana_bundlecreate(struct iguana_info *coin,int32_t *bund
if ( coin->bundlescount > 0 )
coin->bundles[coin->bundlescount-1]->nextbp = bp;
*bundleip = 0;
printf("ht.%d alloc.[%d] new hdrs.%s %s\n",bp->bundleheight,coin->bundlescount,str,bits256_str(str2,allhash));
printf("ht.%d alloc.[%d] new hdrs.%s %s\n",bp->bundleheight,coin->bundlescount,bits256_str(str,bundlehash2),bits256_str(str2,allhash));
iguana_bundlehash2add(coin,0,bp,0,bundlehash2);
if ( issueflag != 0 )
{

1
iguana/iguana_recv.c

@ -292,6 +292,7 @@ uint32_t iguana_allhashcmp(struct iguana_info *coin,struct iguana_bundle *bp,bit
block->mainchain = 1;
if ( prev != 0 )
{
//block->RO.prev_block = prev->RO.hash2;
prev->hh.next = block;
block->hh.prev = prev;
}

2
iguana/main.c

@ -37,7 +37,7 @@ static int32_t initflag;
#ifdef __linux__
int32_t IGUANA_NUMHELPERS = 8;
#else
int32_t IGUANA_NUMHELPERS = 4;
int32_t IGUANA_NUMHELPERS = 1;
#endif
char *hash_parser(struct supernet_info *myinfo,char *hashname,cJSON *json,char *remoteaddr)

Loading…
Cancel
Save