Browse Source

test

release/v0.1
jl777 9 years ago
parent
commit
89537eea02
  1. 6
      iguana/iguana_init.c

6
iguana/iguana_init.c

@ -344,17 +344,19 @@ void iguana_parseline(struct iguana_info *coin,int32_t iter,FILE *fp)
vupdate_sha256(balancehash.bytes,&vstate,0,0); vupdate_sha256(balancehash.bytes,&vstate,0,0);
for (i=0; i<coin->balanceswritten; i++) for (i=0; i<coin->balanceswritten; i++)
{ {
numpkinds = numunspents = 0;
Aptr = 0, Uptr = 0;
if ( (bp= coin->bundles[i]) != 0 && bp->ramchain.H.data != 0 && (numpkinds= bp->ramchain.H.data->numpkinds) > 0 && (numunspents= bp->ramchain.H.data->numunspents) > 0 && (Aptr= bp->ramchain.A) != 0 && (Uptr= bp->ramchain.Uextras) != 0 ) if ( (bp= coin->bundles[i]) != 0 && bp->ramchain.H.data != 0 && (numpkinds= bp->ramchain.H.data->numpkinds) > 0 && (numunspents= bp->ramchain.H.data->numunspents) > 0 && (Aptr= bp->ramchain.A) != 0 && (Uptr= bp->ramchain.Uextras) != 0 )
{ {
vupdate_sha256(balancehash.bytes,&vstate,(void *)Aptr,sizeof(*Aptr)*numpkinds); vupdate_sha256(balancehash.bytes,&vstate,(void *)Aptr,sizeof(*Aptr)*numpkinds);
vupdate_sha256(balancehash.bytes,&vstate,(void *)Uptr,sizeof(*Uptr)*numunspents); vupdate_sha256(balancehash.bytes,&vstate,(void *)Uptr,sizeof(*Uptr)*numunspents);
} else printf("missing hdrs.[%d]\n",i); } else printf("missing hdrs.[%d] data.%p num.(%u %d) %p %p\n",i,bp->ramchain.H.data,numpkinds,numunspents,Aptr,Uptr);
} }
char str[65],str2[65]; printf("written.%d balancehash.(%s) vs (%s)\n",coin->balanceswritten,bits256_str(str,balancehash),bits256_str(str2,coin->balancehash)); char str[65],str2[65]; printf("written.%d balancehash.(%s) vs (%s)\n",coin->balanceswritten,bits256_str(str,balancehash),bits256_str(str2,coin->balancehash));
if ( memcmp(balancehash.bytes,coin->balancehash.bytes,sizeof(balancehash)) != 0 ) if ( memcmp(balancehash.bytes,coin->balancehash.bytes,sizeof(balancehash)) != 0 )
{ {
printf("balancehash mismatch\n"); printf("balancehash mismatch\n");
//iguana_truncatebalances(coin); iguana_truncatebalances(coin);
} else printf("MATCHED balancehash numhdrsi.%d\n",coin->balanceswritten); } else printf("MATCHED balancehash numhdrsi.%d\n",coin->balanceswritten);
} }
} }

Loading…
Cancel
Save