Browse Source

test

release/v0.1
jl777 8 years ago
parent
commit
c3a394f342
  1. 2
      iguana/iguana777.c
  2. 22
      iguana/iguana_realtime.c
  3. 6
      iguana/iguana_recv.c

2
iguana/iguana777.c

@ -384,7 +384,7 @@ int32_t iguana_helperA(struct supernet_info *myinfo,struct iguana_info *coin,int
printf("iguana_helperA unexpected null bp\n");
return(-1);
}
printf("helperid.%d validate gen utxo.[%d] utxofinish.%u\n",helperid,bp->hdrsi,bp->utxofinish);
//printf("helperid.%d validate gen utxo.[%d] utxofinish.%u\n",helperid,bp->hdrsi,bp->utxofinish);
if ( iguana_bundlevalidate(myinfo,coin,bp,0) == bp->n ) //
{
retval = 0;

22
iguana/iguana_realtime.c

@ -1017,19 +1017,19 @@ int32_t iguana_RTiterate(struct supernet_info *myinfo,struct iguana_info *coin,i
bp->blocks[block->bundlei] = block;
bp->hashes[block->bundlei] = block->RO.hash2;
block->height = coin->firstRTheight+offset;
}
iguana_blockQ("RTiterate",coin,bp,block->bundlei,block->RO.hash2,1);
if ( 0 && coin->peers != 0 )
{
if ( coin->peers->numranked > 0 )
if ( coin->peers != 0 )
{
for (i=0; i<coin->peers->numranked&&i<8; i++)
if ( (addr= coin->peers->ranked[i]) != 0 )
{
iguana_sendblockreqPT(coin,addr,coin->bundles[block->hdrsi],block->bundlei,block->RO.hash2,1);
}
} else iguana_updatemetrics(myinfo,coin);
if ( coin->peers->numranked > 0 )
{
for (i=0; i<coin->peers->numranked&&i<8; i++)
if ( (addr= coin->peers->ranked[i]) != 0 )
{
iguana_sendblockreqPT(coin,addr,coin->bundles[block->hdrsi],block->bundlei,block->RO.hash2,1);
}
} else iguana_updatemetrics(myinfo,coin);
}
}
iguana_blockQ("RTiterate",coin,bp,block->bundlei,block->RO.hash2,1);
num = 0;
for (height=block->height+1; height<=coin->blocks.hwmchain.height; height++)
{break;

6
iguana/iguana_recv.c

@ -124,7 +124,7 @@ int32_t iguana_sendblockreqPT(struct iguana_info *coin,struct iguana_peer *addr,
}
if ( block != 0 )
block->issued = addr->pendtime;
if ( coin->RTheight > 0 && coin->current == bp )
if ( coin->RTheight > 0 )//&& coin->current == bp )
printf("REQ.(%s) [%d:%d] %s n.%d\n",bits256_str(hexstr,hash2),bundlei,bp!=0?bp->hdrsi:-1,addr->ipaddr,addr->pendblocks);
} else printf("MSG_BLOCK null datalen.%d\n",len);
return(len);
@ -797,6 +797,8 @@ void iguana_gotblockM(struct supernet_info *myinfo,struct iguana_info *coin,stru
bp->speculative[bundlei] = bp->hashes[bundlei];
bp->blocks[bundlei] = block;
}
numtx = origtxdata->zblock.RO.txn_count;
iguana_RTgotblock(coin,origtxdata->zblock.RO.hash2,data,&recvlen,&numtx);
printf("getblockM update [%d:%d] %s\n",bp->hdrsi,bundlei,bits256_str(str,origtxdata->zblock.RO.hash2));
block->txvalid = 1;
if ( block->fpipbits != 0 && block->fpos >= 0 )
@ -821,8 +823,6 @@ void iguana_gotblockM(struct supernet_info *myinfo,struct iguana_info *coin,stru
txdata->zblock.fpipbits = (uint32_t)addr->ipbits;
txdata->zblock.RO.recvlen = recvlen;
txdata->zblock.fpos = 0;
numtx = origtxdata->zblock.RO.txn_count;
iguana_RTgotblock(coin,txdata->zblock.RO.hash2,data,&recvlen,&numtx);
copyflag = (coin->enableCACHE != 0) && (strcmp(coin->symbol,"BTC") != 0);
req = iguana_recv_bundlereq(coin,addr,copyflag,H,data,recvlen,bp,bundlei,txdata);
queue_enqueue("recvQ",&coin->recvQ,&req->DL,0);

Loading…
Cancel
Save