diff --git a/iguana/iguana777.c b/iguana/iguana777.c index 0671bccaf..4f063c606 100755 --- a/iguana/iguana777.c +++ b/iguana/iguana777.c @@ -803,7 +803,7 @@ struct iguana_info *iguana_setcoin(char *symbol,void *launched,int32_t maxpeers, // maxval = (int32_t)coin->MAXMEM; coin->MAXMEM *= (1024L * 1024 * 1024); #ifdef __PNACL__ - maxval = 1;// * (strcmp("BTC",coin->symbol) != 0) + 8; + //maxval = 1;// * (strcmp("BTC",coin->symbol) != 0) + 8; //if ( mult > 1 ) // mult /= 2; #endif diff --git a/iguana/iguana_blocks.c b/iguana/iguana_blocks.c index 5cc35c8a6..7f2b01c0e 100755 --- a/iguana/iguana_blocks.c +++ b/iguana/iguana_blocks.c @@ -144,22 +144,12 @@ bits256 *iguana_blockhashptr(struct iguana_info *coin,int32_t height) { hdrsi = (height / bundlesize); bundlei = height - (hdrsi * bundlesize); - if ( hdrsi >= 0 && hdrsi < bundlesize && bundlei >= 0 && bundlei < bundlesize && (bp= coin->bundles[hdrsi]) != 0 ) + if ( hdrsi >= 0 && hdrsi < coin->bundlescount && bundlei >= 0 && bundlei < bundlesize ) { - return(&bp->hashes[bundlei]); + if ( (bp= coin->bundles[hdrsi]) != 0 ) + return(&bp->hashes[bundlei]); + else return(0); } - /*for (i=0; ibundlescount; i++) - { - if ( (bp= coin->bundles[i]) != 0 ) - { - if ( height >= bp->bundleheight && height < bp->bundleheight+bp->n ) - { - hashptr = &bp->hashes[height - bp->bundleheight]; - //printf("i.%d hashptr.%p height.%d vs (%d %d)\n",i,hashptr,height,bp->bundleheight,bp->bundleheight+bp->n); - return(hashptr); - } - } - }*/ } return(0); } diff --git a/iguana/iguana_payments.c b/iguana/iguana_payments.c index edb74b276..b8d74c1be 100755 --- a/iguana/iguana_payments.c +++ b/iguana/iguana_payments.c @@ -919,7 +919,7 @@ HASH_AND_INT(bitcoinrpc,getrawtransaction,txid,verbose) return(jprint(txobj,1)); } jaddstr(retjson,"result",txbytes); - printf("txbytes.(%s) len.%d (%s)\n",txbytes,len,jprint(retjson,0)); + char str[65]; printf("txbytes.(%s) len.%d (%s) %s\n",txbytes,len,jprint(retjson,0),bits256_str(str,checktxid)); free(txbytes); return(jprint(retjson,1)); } diff --git a/iguana/iguana_sign.c b/iguana/iguana_sign.c index 43892b9c3..a61b9be39 100755 --- a/iguana/iguana_sign.c +++ b/iguana/iguana_sign.c @@ -90,7 +90,7 @@ int32_t iguana_voutparse(int32_t rwflag,uint8_t *serialized,struct iguana_msgvou if ( rwflag == 0 ) msg->pk_script = &serialized[len]; else memcpy(&serialized[len],msg->pk_script,msg->pk_scriptlen); - if ( 0 ) + if ( 1 ) { int32_t i; for (i=0; ipk_scriptlen; i++) diff --git a/iguana/iguana_txidfind.c b/iguana/iguana_txidfind.c index 63e8383be..d3aa49e59 100755 --- a/iguana/iguana_txidfind.c +++ b/iguana/iguana_txidfind.c @@ -266,6 +266,7 @@ struct iguana_txid *iguana_txidfind(struct iguana_info *coin,int32_t *heightp,st uint8_t *TXbits; struct iguana_txid *T; uint32_t txidind; int32_t i; struct iguana_bundle *bp; struct iguana_ramchain *ramchain; //struct iguana_block *block; *heightp = -1; + memset(tx,0,sizeof(*tx)); if ( lasthdrsi < 0 ) return(0); for (i=lasthdrsi; i>=0; i--) @@ -323,6 +324,7 @@ struct iguana_txid *iguana_txidfind(struct iguana_info *coin,int32_t *heightp,st *heightp = bp->bundleheight + T[txidind].bundlei; //printf("found height.%d\n",*heightp); *tx = T[txidind]; + //printf("[%d] txidind.%d 1st.(%d %d)\n",bp->hdrsi,txidind,tx->firstvout,tx->firstvin); return(tx); } }