Browse Source

test

release/v0.1
jl777 9 years ago
parent
commit
0375a22698
  1. 2
      iguana/iguana777.h
  2. 4
      iguana/iguana_bundles.c
  3. 2
      iguana/iguana_recv.c
  4. 5
      iguana/iguana_unspents.c
  5. 35
      iguana/main.c

2
iguana/iguana777.h

@ -39,7 +39,7 @@ typedef int32_t (*blockhashfunc)(uint8_t *blockhashp,uint8_t *serialized,int32_t
#define IGUANA_MAXPENDHDRS 1
#define _IGUANA_MAXPENDING 3
#define IGUANA_MINPENDBUNDLES 2
#define IGUANA_MAXPENDBUNDLES 2
#define IGUANA_MAXPENDBUNDLES 64
#define IGUANA_BUNDLELOOP 77
#define IGUANA_RPCPORT 7778
#define IGUANA_MAXRAMCHAINSIZE ((uint64_t)1024L * 1024L * 1024L * 16)

4
iguana/iguana_bundles.c

@ -514,7 +514,7 @@ int32_t iguana_bundleissue(struct iguana_info *coin,struct iguana_bundle *bp,int
bp->issued[i] = block->issued = now;
}
}
printf("kill peer.%d %s reissued\n",i,addr->ipaddr);
printf("slow peer.%d dead.%u (%s) reissued.%d\n",i,addr->dead,addr->ipaddr,flag);
}
}
}
@ -848,7 +848,7 @@ int32_t iguana_bundleiters(struct iguana_info *coin,struct OS_memspace *mem,stru
{
if ( iguana_bundlesaveHT(coin,mem,memB,bp,(uint32_t)time(NULL)) == 0 )
{
fprintf(stderr,"emitQ done coin.%p bp.[%d] ht.%d\n",coin,bp->hdrsi,bp->bundleheight);
//fprintf(stderr,"emitQ done coin.%p bp.[%d] ht.%d\n",coin,bp->hdrsi,bp->bundleheight);
bp->emitfinish = (uint32_t)time(NULL) + 1;
coin->numemitted++;
}

2
iguana/iguana_recv.c

@ -191,7 +191,7 @@ void iguana_gotblockM(struct iguana_info *coin,struct iguana_peer *addr,struct i
printf("got block that doesnt validate? %s\n",bits256_str(str,origtxdata->block.RO.hash2));
return;
}
else if ( 0 && coin->enableCACHE != 0 )
else //if ( 0 && coin->enableCACHE != 0 )
printf("validated.(%s)\n",bits256_str(str,origtxdata->block.RO.hash2));
copyflag = coin->enableCACHE;
bp = 0, bundlei = -2;

5
iguana/iguana_unspents.c

@ -44,6 +44,11 @@ int32_t iguana_utxoupdate(struct iguana_info *coin,uint16_t spent_hdris,uint32_t
return(0);
}
void iguana_realtime_update(struct iguana_info *coin)
{
}
struct iguana_pkhash *iguana_pkhashfind(struct iguana_info *coin,struct iguana_ramchain **ramchainp,int64_t *balancep,uint32_t *lastunspentindp,struct iguana_pkhash *p,uint8_t rmd160[20],int32_t firsti,int32_t endi)
{
uint8_t *PKbits; struct iguana_pkhash *P; uint32_t pkind,i; struct iguana_bundle *bp; struct iguana_ramchain *ramchain; struct iguana_account *ACCTS;

35
iguana/main.c

@ -450,33 +450,29 @@ void mainloop(struct supernet_info *myinfo)
if ( (coin= Coins[i]) != 0 && coin->active != 0 && (bp= coin->current) != 0 && coin->started != 0 )
{
flag++;
iguana_realtime_update(coin);
if ( (ptr= queue_dequeue(&balancesQ,0)) != 0 )
{
if ( (bp= ptr->bp) != 0 && ptr->coin != 0 && (bp->hdrsi == 0 || (prevbp= coin->bundles[bp->hdrsi-1]) != 0) )
{
if ( bp->ramchain.Uextras == 0 )
{
printf("alloc Uextras.[%d]\n",bp->hdrsi);
bp->ramchain.Uextras = calloc(sizeof(*bp->ramchain.Uextras),bp->ramchain.H.data->numunspents + 16);
}
if ( bp->ramchain.A == 0 )
{
printf("alloc A2.[%d]\n",bp->hdrsi);
bp->ramchain.A = calloc(sizeof(*bp->ramchain.A),bp->ramchain.H.data->numpkinds + 16);
}
for (j=0; j<bp->hdrsi; j++)
{
if ( (prevbp= coin->bundles[j]) == 0 || prevbp->utxofinish <= 1 )
break;
//prevbp->ramchain.A = 0;
//prevbp->ramchain.Uextras = 0;
}
if ( bp->utxofinish > 1 && bp->balancefinish <= 1 && bp->hdrsi == j )
{
//printf("hdrsi.%d start balances.%d\n",bp->hdrsi,bp->bundleheight);
//bp->ramchain.A = 0;
//bp->ramchain.Uextras = 0;
iguana_balancecalc(ptr->coin,bp,bp == coin->current);
if ( bp->ramchain.Uextras == 0 )
{
printf("alloc Uextras.[%d]\n",bp->hdrsi);
bp->ramchain.Uextras = calloc(sizeof(*bp->ramchain.Uextras),bp->ramchain.H.data->numunspents + 16);
}
if ( bp->ramchain.A == 0 )
{
printf("alloc A2.[%d]\n",bp->hdrsi);
bp->ramchain.A = calloc(sizeof(*bp->ramchain.A),bp->ramchain.H.data->numpkinds + 16);
}
iguana_balancecalc(ptr->coin,bp,bp->hdrsi >= coin->balanceswritten);
bp->queued = 0;
if ( bp->hdrsi == coin->longestchain/coin->chain->bundlesize-1 )
{
@ -496,12 +492,9 @@ void mainloop(struct supernet_info *myinfo)
}
}
iguana_jsonQ();
pangea_queues(SuperNET_MYINFO(0));
if ( flag == 0 )
{
pangea_queues(SuperNET_MYINFO(0));
usleep(1000000);
}
else usleep(100000);
usleep(100000);
}
}

Loading…
Cancel
Save