Browse Source

test

release/v0.1
jl777 9 years ago
parent
commit
fbb309115b
  1. 2
      iguana/iguana777.h
  2. 2
      iguana/iguana_ramchain.c
  3. 15
      iguana/iguana_recv.c
  4. 2
      iguana/iguana_unspents.c

2
iguana/iguana777.h

@ -18,7 +18,7 @@
#include "../crypto777/OS_portable.h"
#include "SuperNET.h"
#define SPARSECOUNT(x) ((x) << 2)
#define SPARSECOUNT(x) ((x) << 1)
typedef int32_t (*blockhashfunc)(uint8_t *blockhashp,uint8_t *serialized,int32_t len);

2
iguana/iguana_ramchain.c

@ -665,7 +665,7 @@ void iguana_ramchain_prefetch(struct iguana_info *coin,struct iguana_ramchain *r
int64_t _iguana_rdata_action(FILE *fp,bits256 lhashes[IGUANA_NUMLHASHES],void *destptr,uint64_t fpos,uint32_t expanded,uint32_t numtxids,uint32_t numunspents,uint32_t numspends,uint32_t numpkinds,uint32_t numexternaltxids,uint32_t scriptspace,uint32_t txsparsebits,uint64_t numtxsparse,uint32_t pksparsebits,uint64_t numpksparse,uint64_t srcsize,RAMCHAIN_FUNC,int32_t numblocks)
{
#define RAMCHAIN_LARG(ind) ((lhashes == 0) ? 0 : lhashes[ind].bytes)
#define SPARSECOUNT(x) ((x) << 2)
#define SPARSECOUNT(x) ((x) << 1)
FILE *fparg = 0; int32_t iter; uint64_t txbits,pkbits,offset = 0; struct iguana_ramchaindata *rdata = destptr;
if ( expanded != 0 )
{

15
iguana/iguana_recv.c

@ -735,12 +735,15 @@ struct iguana_bundlereq *iguana_recvblockhashes(struct iguana_info *coin,struct
struct iguana_bundlereq *iguana_recvblock(struct iguana_info *coin,struct iguana_peer *addr,struct iguana_bundlereq *req,struct iguana_block *origblock,int32_t numtx,int32_t datalen,int32_t recvlen,int32_t *newhwmp)
{
struct iguana_bundle *bp=0; int32_t i,width,numsaved=0,bundlei = -2; struct iguana_block *block,*tmpblock,*prev; char str[65];
struct iguana_bundle *bp=0; int32_t width,numsaved=0,bundlei = -2; struct iguana_block *block,*tmpblock,*prev; char str[65];
if ( (bp= iguana_bundleset(coin,&block,&bundlei,origblock)) == 0 )
{
if ( (bp= iguana_bundlefind(coin,&bp,&bundlei,origblock->RO.hash2)) != 0 )
if ( (bp= iguana_bundlefind(coin,&bp,&bundlei,origblock->RO.prev_block)) != 0 )
{
printf("iguana_recvblock got block [%d:%d]\n",bp->hdrsi,bundlei);
printf("iguana_recvblock got prev block [%d:%d]\n",bp->hdrsi,bundlei);
if ( bundlei < bp->n-1 )
bundlei++;
else bp = 0, bundlei = -2;
/*if ( bits256_cmp(prev->RO.hash2,block->RO.prev_block) == 0 && bundlei < bp->n-1 )
{
bundlei++;
@ -756,7 +759,7 @@ struct iguana_bundlereq *iguana_recvblock(struct iguana_info *coin,struct iguana
} else printf("error adding speculative prev [%d:%d]\n",bp->hdrsi,bundlei);
}*/
}
for (i=coin->bundlescount-1; i>=0; i--)
/*for (i=coin->bundlescount-1; i>=0; i--)
{
//if ( coin->bundles[i] != 0 )
// printf("compare vs %s\n",bits256_str(str,coin->bundles[i]->hashes[0]));
@ -774,10 +777,10 @@ struct iguana_bundlereq *iguana_recvblock(struct iguana_info *coin,struct iguana
}
break;
}
}
}*/
//printf("i.%d ref prev.(%s)\n",i,bits256_str(str,origblock->RO.prev_block));
}
else if ( bp == coin->current && bp != 0 && block != 0 && bundlei >= 0 )
if ( bp == coin->current && bp != 0 && block != 0 && bundlei >= 0 )
{
if ( bp->speculative != 0 && bp->numspec <= bundlei )
{

2
iguana/iguana_unspents.c

@ -658,7 +658,7 @@ int32_t iguana_spendvectors(struct iguana_info *coin,struct iguana_bundle *bp)
iguana_ramchain_prefetch(coin,ramchain);
for (i=0; i<bp->n; i++)
{
printf("spendvectors [%d:%d] numtx.%d\n",bp->hdrsi,i,B[i].txn_count);
printf("spendvectors elapsed.%-3d [%-3d:%4d] numtx.%d\n",(uint32_t)time(NULL)-starttime,bp->hdrsi,i,B[i].txn_count);
if ( txidind != B[i].firsttxidind || spendind != B[i].firstvin )
{
printf("utxogen: txidind %u != %u B[%d].firsttxidind || spendind %u != %u B[%d].firstvin\n",txidind,B[i].firsttxidind,i,spendind,B[i].firstvin,i);

Loading…
Cancel
Save