Browse Source

test

release/v0.1
jl777 9 years ago
parent
commit
b4d317de12
  1. 2
      iguana/iguana_bundles.c
  2. 4
      iguana/iguana_ramchain.c
  3. 6
      iguana/iguana_realtime.c
  4. 2
      iguana/iguana_recv.c
  5. 4
      includes/iguana_funcs.h

2
iguana/iguana_bundles.c

@ -458,8 +458,6 @@ char *iguana_bundleaddrs(struct iguana_info *coin,int32_t hdrsi)
retjson = cJSON_CreateArray(); retjson = cJSON_CreateArray();
PKbits = RAMCHAIN_PTR(rdata,PKoffset); PKbits = RAMCHAIN_PTR(rdata,PKoffset);
P = RAMCHAIN_PTR(rdata,Poffset); P = RAMCHAIN_PTR(rdata,Poffset);
//PKbits = (void *)(long)((long)rdata + rdata->PKoffset);
//P = (void *)(long)((long)rdata + rdata->Poffset);
for (pkind=0; pkind<numpkinds; pkind++,P++) for (pkind=0; pkind<numpkinds; pkind++,P++)
{ {
init_hexbytes_noT(rmdstr,P->rmd160,20); init_hexbytes_noT(rmdstr,P->rmd160,20);

4
iguana/iguana_ramchain.c

@ -2804,7 +2804,7 @@ int32_t iguana_RTramchaindata(struct iguana_info *coin,struct OS_memspace *TXDAT
printf(" script type.%d\n",type); printf(" script type.%d\n",type);
} }
bitcoin_address(coinaddr,coin->chain->pubtype,V.rmd160,sizeof(V.rmd160)); bitcoin_address(coinaddr,coin->chain->pubtype,V.rmd160,sizeof(V.rmd160));
iguana_RTunspent(coin,block,polarity,coinaddr,V.rmd160,tx->txid,j,tx->vouts[j].value); iguana_RTunspent(coin,block,polarity,coinaddr,V.rmd160,type,script,scriptlen,tx->txid,j,tx->vouts[j].value);
} }
ramchain->H.spendind += tx->tx_in; ramchain->H.spendind += tx->tx_in;
} }
@ -2816,7 +2816,7 @@ int32_t iguana_RTramchaindata(struct iguana_info *coin,struct OS_memspace *TXDAT
tx = &txarray[i]; tx = &txarray[i];
for (j=0; j<tx->tx_in; j++) for (j=0; j<tx->tx_in; j++)
{ {
iguana_RTspend(coin,block,polarity,tx->txid,j,tx->vins[j].prev_hash,tx->vins[j].prev_vout); iguana_RTspend(coin,block,polarity,tx->vins[i].vinscript,tx->vins[i].scriptlen,tx->txid,j,tx->vins[j].prev_hash,tx->vins[j].prev_vout);
} }
} }
iguana_RTtxid(coin,block,polarity,i,txn_count,tx->txid,tx->tx_out,tx->tx_in,tx->lock_time,tx->version,tx->timestamp,unspents,spends); iguana_RTtxid(coin,block,polarity,i,txn_count,tx->txid,tx->tx_out,tx->tx_in,tx->lock_time,tx->version,tx->timestamp,unspents,spends);

6
iguana/iguana_realtime.c

@ -464,7 +464,7 @@ int32_t iguana_realtime_update(struct supernet_info *myinfo,struct iguana_info *
return(flag); return(flag);
} }
void iguana_RTunspent(struct iguana_info *coin,struct iguana_block *block,int64_t polarity,char *coinaddr,uint8_t *rmd160,bits256 txid,int32_t vout,int64_t value) void iguana_RTunspent(struct iguana_info *coin,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; int32_t i;
// fill in array element and update counters // fill in array element and update counters
@ -476,7 +476,7 @@ void iguana_RTunspent(struct iguana_info *coin,struct iguana_block *block,int64_
} }
} }
void iguana_RTspend(struct iguana_info *coin,struct iguana_block *block,int64_t polarity,bits256 txid,int32_t vini,bits256 prev_hash,int32_t prev_vout) void iguana_RTspend(struct iguana_info *coin,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)
{ {
char str[65],str2[65]; char str[65],str2[65];
// fill in array element and update counters // fill in array element and update counters
@ -663,7 +663,7 @@ void iguana_RTnewblock(struct iguana_info *coin,struct iguana_block *block)
{ {
if ( (subblock= iguana_RTblock(coin,block->height)) != 0 && subblock != block ) if ( (subblock= iguana_RTblock(coin,block->height)) != 0 && subblock != block )
{ {
iguana_RTblocksub(coin,block); iguana_RTblocksub(coin,subblock);
iguana_RTblockadd(coin,block); iguana_RTblockadd(coin,block);
printf("== RTnewblock RTheight %d prev %d\n",coin->RTheight,coin->lastRTheight); printf("== RTnewblock RTheight %d prev %d\n",coin->RTheight,coin->lastRTheight);
} }

2
iguana/iguana_recv.c

@ -356,7 +356,7 @@ void iguana_gotblockM(struct iguana_info *coin,struct iguana_peer *addr,struct i
received[addr->addrind] += recvlen; received[addr->addrind] += recvlen;
count[addr->addrind]++; count[addr->addrind]++;
now = (uint32_t)time(NULL); now = (uint32_t)time(NULL);
if ( ((rand() % 1000) == 0 && now > last+10) || now > last+600 ) if ( ((rand() % 10000) == 0 && now > last+60) || now > last+600 )
{ {
int64_t sum2 = 0,sum = 0,diffr,diff; double bw = 0.; int64_t sum2 = 0,sum = 0,diffr,diff; double bw = 0.;
for (i=0; i<sizeof(received)/sizeof(*received); i++) for (i=0; i<sizeof(received)/sizeof(*received); i++)

4
includes/iguana_funcs.h

@ -541,8 +541,8 @@ struct iguana_peer *basilisk_ensurerelay(struct supernet_info *myinfo,struct igu
int32_t iguana_datachain_scan(struct supernet_info *myinfo,struct iguana_info *coin,uint8_t rmd160[20]); int32_t iguana_datachain_scan(struct supernet_info *myinfo,struct iguana_info *coin,uint8_t rmd160[20]);
int32_t iguana_RTramchaindata(struct iguana_info *coin,struct OS_memspace *TXDATA,struct OS_memspace *HASHMEM,int64_t polarity,struct iguana_block *block,struct iguana_msgtx *txarray,int32_t txn_count); int32_t iguana_RTramchaindata(struct iguana_info *coin,struct OS_memspace *TXDATA,struct OS_memspace *HASHMEM,int64_t polarity,struct iguana_block *block,struct iguana_msgtx *txarray,int32_t txn_count);
void iguana_RTtxid(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,void *unspents,void *spends); void iguana_RTtxid(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,void *unspents,void *spends);
void iguana_RTspend(struct iguana_info *coin,struct iguana_block *block,int64_t polarity,bits256 txid,int32_t vini,bits256 prev_hash,int32_t prev_vout); void iguana_RTspend(struct iguana_info *coin,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_RTunspent(struct iguana_info *coin,struct iguana_block *block,int64_t polarity,char *coinaddr,uint8_t *rmd160,bits256 txid,int32_t vout,int64_t value); void iguana_RTunspent(struct iguana_info *coin,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_RTnewblock(struct iguana_info *coin,struct iguana_block *block); void iguana_RTnewblock(struct iguana_info *coin,struct iguana_block *block);
void *iguana_RTrawdata(struct iguana_info *coin,bits256 hash2,uint8_t *data,int32_t *recvlenp,int32_t *numtxp); void *iguana_RTrawdata(struct iguana_info *coin,bits256 hash2,uint8_t *data,int32_t *recvlenp,int32_t *numtxp);
void iguana_RTramchainalloc(char *fname,struct iguana_info *coin,struct iguana_bundle *bp); void iguana_RTramchainalloc(char *fname,struct iguana_info *coin,struct iguana_bundle *bp);

Loading…
Cancel
Save