diff --git a/iguana/iguana_bundles.c b/iguana/iguana_bundles.c index 7a24e2d5f..483608128 100755 --- a/iguana/iguana_bundles.c +++ b/iguana/iguana_bundles.c @@ -458,8 +458,6 @@ char *iguana_bundleaddrs(struct iguana_info *coin,int32_t hdrsi) retjson = cJSON_CreateArray(); PKbits = RAMCHAIN_PTR(rdata,PKoffset); P = RAMCHAIN_PTR(rdata,Poffset); - //PKbits = (void *)(long)((long)rdata + rdata->PKoffset); - //P = (void *)(long)((long)rdata + rdata->Poffset); for (pkind=0; pkindrmd160,20); diff --git a/iguana/iguana_ramchain.c b/iguana/iguana_ramchain.c index 89444abf1..a656b9b7b 100755 --- a/iguana/iguana_ramchain.c +++ b/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); } 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; } @@ -2816,7 +2816,7 @@ int32_t iguana_RTramchaindata(struct iguana_info *coin,struct OS_memspace *TXDAT tx = &txarray[i]; for (j=0; jtx_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); diff --git a/iguana/iguana_realtime.c b/iguana/iguana_realtime.c index 746bb1a38..1bda3df75 100755 --- a/iguana/iguana_realtime.c +++ b/iguana/iguana_realtime.c @@ -464,7 +464,7 @@ int32_t iguana_realtime_update(struct supernet_info *myinfo,struct iguana_info * 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; // 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]; // 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 ) { - iguana_RTblocksub(coin,block); + iguana_RTblocksub(coin,subblock); iguana_RTblockadd(coin,block); printf("== RTnewblock RTheight %d prev %d\n",coin->RTheight,coin->lastRTheight); } diff --git a/iguana/iguana_recv.c b/iguana/iguana_recv.c index fbd5479b6..32fa5c98f 100755 --- a/iguana/iguana_recv.c +++ b/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; count[addr->addrind]++; 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.; for (i=0; i