Browse Source

test

release/v0.1
jl777 9 years ago
parent
commit
3e0bd41fe1
  1. 8
      iguana/iguana_realtime.c
  2. 4
      iguana/iguana_recv.c

8
iguana/iguana_realtime.c

@ -153,14 +153,14 @@ void iguana_RTcoinaddr(struct iguana_info *coin,struct iguana_RTtxid *RTptr,stru
coin->RTcredits += polarity * value; coin->RTcredits += polarity * value;
if ( polarity > 0 ) if ( polarity > 0 )
{ {
printf("%s lastunspent[%d] <- %p\n",coinaddr,RTaddr->numunspents,unspent); //printf("%s lastunspent[%d] <- %p\n",coinaddr,RTaddr->numunspents,unspent);
RTaddr->numunspents++; RTaddr->numunspents++;
unspent->prevunspent = RTaddr->lastunspent; unspent->prevunspent = RTaddr->lastunspent;
RTaddr->lastunspent = unspent; RTaddr->lastunspent = unspent;
} }
else if ( polarity < 0 ) else if ( polarity < 0 )
{ {
printf("%s lastunspent[%d] -> last.%p %p\n",coinaddr,RTaddr->numunspents,RTaddr->lastunspent,unspent); //printf("%s lastunspent[%d] -> last.%p %p\n",coinaddr,RTaddr->numunspents,RTaddr->lastunspent,unspent);
if ( RTaddr->lastunspent == unspent ) if ( RTaddr->lastunspent == unspent )
{ {
RTaddr->lastunspent = unspent->prevunspent; RTaddr->lastunspent = unspent->prevunspent;
@ -192,7 +192,7 @@ struct iguana_RTunspent *iguana_RTunspent_create(uint8_t *rmd160,int64_t value,u
void iguana_RTunspent(struct iguana_info *coin,struct iguana_RTtxid *RTptr,struct iguana_block *block,int64_t polarity,char *coinaddr,uint8_t *rmd160,int32_t type,uint8_t *script,int32_t scriptlen,bits256 txid,int32_t vout,int64_t value) void iguana_RTunspent(struct iguana_info *coin,struct iguana_RTtxid *RTptr,struct iguana_block *block,int64_t polarity,char *coinaddr,uint8_t *rmd160,int32_t type,uint8_t *script,int32_t scriptlen,bits256 txid,int32_t vout,int64_t value)
{ {
int32_t i; struct iguana_RTunspent *unspent; char str[65]; 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)); //printf("iguana_RTunspent.%lld %s vout.%d %.8f\n",(long long)polarity,coinaddr,vout,dstr(value));
//fprintf(stderr,"+"); //fprintf(stderr,"+");
if ( RTptr != 0 ) if ( RTptr != 0 )
{ {
@ -247,7 +247,7 @@ void iguana_RTvout_create(struct iguana_info *coin,int64_t polarity,struct iguan
void iguana_RTspend_create(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) void iguana_RTspend_create(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)
{ {
struct iguana_RTspend *spend; struct iguana_RTtxid *spentRTptr; struct iguana_RTunspent *unspent=0; char str[65],str2[65],coinaddr[64]; uint8_t addrtype,rmd160[20],spendscript[IGUANA_MAXSCRIPTSIZE]; uint32_t unspentind; int32_t spendlen,height; uint64_t RTspent,value; struct iguana_outpoint spentpt; struct iguana_RTspend *spend; struct iguana_RTtxid *spentRTptr; struct iguana_RTunspent *unspent=0; char str[65],str2[65],coinaddr[64]; uint8_t addrtype,rmd160[20],spendscript[IGUANA_MAXSCRIPTSIZE]; uint32_t unspentind; int32_t spendlen,height; uint64_t RTspent,value; struct iguana_outpoint spentpt;
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); //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 ) if ( vini == 0 && bits256_nonz(prev_hash) == 0 && prev_vout < 0 )
return; return;
//fprintf(stderr,"-"); //fprintf(stderr,"-");

4
iguana/iguana_recv.c

@ -1083,7 +1083,7 @@ int32_t iguana_bundlehashadd(struct iguana_info *coin,struct iguana_bundle *bp,i
void iguana_bundle_set(struct iguana_info *coin,struct iguana_block *block,int32_t height) void iguana_bundle_set(struct iguana_info *coin,struct iguana_block *block,int32_t height)
{ {
int32_t hdrsi,bundlei; struct iguana_bundle *bp; int32_t hdrsi,bundlei; struct iguana_bundle *bp; char str[65];
if ( block->height < 0 || block->height == height ) if ( block->height < 0 || block->height == height )
{ {
hdrsi = (height / coin->chain->bundlesize); hdrsi = (height / coin->chain->bundlesize);
@ -1096,7 +1096,7 @@ void iguana_bundle_set(struct iguana_info *coin,struct iguana_block *block,int32
bp->speculative[bundlei] = block->RO.hash2; bp->speculative[bundlei] = block->RO.hash2;
//char str[65]; printf("SET %s ht.%d in [%d:%d]\n",bits256_str(str,block->RO.hash2),height,hdrsi,bundlei); //char str[65]; printf("SET %s ht.%d in [%d:%d]\n",bits256_str(str,block->RO.hash2),height,hdrsi,bundlei);
} //else printf("iguana_bundle_set: no bundle at [%d]\n",hdrsi); } //else printf("iguana_bundle_set: no bundle at [%d]\n",hdrsi);
} else printf("iguana_bundle_set: mismatch ht.%d vs %d\n",block->height,height); } else printf("iguana_bundle_set: %s mismatch ht.%d vs %d\n",bits256_str(str,block->RO.hash2),block->height,height);
} }
void iguana_hwmchain_set(struct iguana_info *coin,struct iguana_block *block,int32_t height) void iguana_hwmchain_set(struct iguana_info *coin,struct iguana_block *block,int32_t height)

Loading…
Cancel
Save