Browse Source

test

release/v0.1
jl777 9 years ago
parent
commit
246017927f
  1. 14
      iguana/iguana_realtime.c

14
iguana/iguana_realtime.c

@ -607,6 +607,7 @@ void iguana_RTunspent(struct iguana_info *coin,struct iguana_RTtxid *RTptr,struc
{
int32_t i; struct iguana_RTunspent *unspent; char str[65];
//printf("iguana_RTunspent.%lld %s vout.%d %.8f\n",(long long)polarity,coinaddr,vout,dstr(value));
fprintf(stderr,"+");
if ( RTptr != 0 )
{
if ( bits256_cmp(RTptr->txid,txid) == 0 )
@ -640,6 +641,7 @@ void iguana_RTunspent(struct iguana_info *coin,struct iguana_RTtxid *RTptr,struc
printf("%02x",rmd160[i]);
printf(" %s vout.%d %.8f %lld\n",coinaddr,vout,dstr(value),(long long)polarity);
}
fprintf(stderr,",");
}
void iguana_RTspend(struct supernet_info *myinfo,struct iguana_info *coin,struct iguana_RTtxid *RTptr,struct iguana_block *block,int64_t polarity,uint8_t *script,int32_t scriptlen,bits256 txid,int32_t vini,bits256 prev_hash,int32_t prev_vout)
@ -648,6 +650,7 @@ void iguana_RTspend(struct supernet_info *myinfo,struct iguana_info *coin,struct
//printf("RTspend %s vini.%d spend.(%s/v%d) %lld\n",bits256_str(str,txid),vini,bits256_str(str2,prev_hash),prev_vout,(long long)polarity);
if ( vini == 0 && bits256_nonz(prev_hash) == 0 && prev_vout < 0 )
return;
fprintf(stderr,"-");
if ( RTptr != 0 )
{
if ( bits256_cmp(RTptr->txid,txid) == 0 )
@ -709,6 +712,7 @@ void iguana_RTspend(struct supernet_info *myinfo,struct iguana_info *coin,struct
}
} else printf("iguana_RTspend txid mismatch %llx != %llx\n",(long long)RTptr->txid.txid,(long long)txid.txid);
} else printf("null rtptr? %s vini.%d spend.(%s/v%d) %lld\n",bits256_str(str,txid),vini,bits256_str(str2,prev_hash),prev_vout,(long long)polarity);
fprintf(stderr,",");
}
struct iguana_RTtxid *iguana_RTtxid_create(struct iguana_info *coin,struct iguana_block *block,int64_t polarity,int32_t txi,int32_t txn_count,bits256 txid,int32_t numvouts,int32_t numvins,uint32_t locktime,uint32_t version,uint32_t timestamp)
@ -719,6 +723,7 @@ struct iguana_RTtxid *iguana_RTtxid_create(struct iguana_info *coin,struct iguan
printf("iguana_RTtxid_create: illegal block height.%d\n",block!=0?block->height:-1);
return(0);
}
fprintf(stderr,"t");
HASH_FIND(hh,coin->RTdataset,txid.bytes,sizeof(txid),RTptr);
if ( RTptr == 0 )
{
@ -744,6 +749,9 @@ struct iguana_RTtxid *iguana_RTtxid_create(struct iguana_info *coin,struct iguan
printf("%s inconsistent counts.(%d %d %d) vs (%d %d %d)\n",bits256_str(str,txid),RTptr->txn_count,RTptr->numvouts,RTptr->numvins,txn_count,numvouts,numvins);
return(0);
}
fprintf(stderr," %d ",txi);
if ( txi == txn_count-1 )
fprintf(stderr," ht.%d\n",block->height);
return(RTptr);
}
@ -893,7 +901,7 @@ int32_t iguana_RTiterate(struct supernet_info *myinfo,struct iguana_info *coin,i
printf("B errs.%d cant load %s ht.%d polarity.%lld numtx.%d %p recvlen.%d\n",errs,bits256_str(str,block->RO.hash2),block->height,(long long)polarity,coin->RTnumtx[offset],coin->RTrawdata[offset],coin->RTrecvlens[offset]);
struct iguana_peer *addr;
iguana_blockQ("RTiterate",coin,0,-1,block->RO.hash2,1);
if ( coin->peers != 0 && coin->peers->numranked > 0 )
if ( 0 && coin->peers != 0 && coin->peers->numranked > 0 )
{
for (i=0; i<coin->peers->numranked&&i<8; i++)
if ( (addr= coin->peers->ranked[i]) != 0 )
@ -911,7 +919,7 @@ int32_t iguana_RTiterate(struct supernet_info *myinfo,struct iguana_info *coin,i
{
num++;
iguana_blockQ("RTiterate",coin,0,-1,block->RO.hash2,1);
if ( coin->peers != 0 && (n= coin->peers->numranked) > 0 )
if ( 0 && coin->peers != 0 && (n= coin->peers->numranked) > 0 )
{
if ( (addr= coin->peers->ranked[rand() % n]) != 0 )
iguana_sendblockreqPT(coin,addr,0,-1,block->RO.hash2,1);
@ -934,8 +942,10 @@ int32_t iguana_RTiterate(struct supernet_info *myinfo,struct iguana_info *coin,i
memset(&txdata,0,sizeof(txdata));
//extern int32_t debugtest;
//debugtest = 1;
fprintf(stderr,"T");
if ( (n= iguana_gentxarray(coin,&coin->RTrawmem,&txdata,&len,serialized,recvlen)) > 0 )
{
fprintf(stderr,"R");
iguana_RTramchaindata(myinfo,coin,&coin->RTmem,&coin->RThashmem,polarity,block,coin->RTrawmem.ptr,numtx);
return(0);
} else printf("gentxarray n.%d RO.txn_count.%d recvlen.%d\n",n,numtx,recvlen);

Loading…
Cancel
Save