From bfc5dc45b1df1a6aa256d7b7cd8119397fe27245 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 20 Apr 2016 19:43:33 -0500 Subject: [PATCH] test --- iguana/iguana777.c | 4 ++-- iguana/iguana_ramchain.c | 32 +++++++++++++++++++------------- 2 files changed, 21 insertions(+), 15 deletions(-) diff --git a/iguana/iguana777.c b/iguana/iguana777.c index 513c7695c..ec39e7a99 100755 --- a/iguana/iguana777.c +++ b/iguana/iguana777.c @@ -741,7 +741,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 @@ -767,7 +767,7 @@ struct iguana_info *iguana_setcoin(char *symbol,void *launched,int32_t maxpeers, else if ( coin->endPEND < 2 ) coin->endPEND = 2; #ifdef __PNACL__ - coin->startPEND = coin->endPEND = 1; + //coin->startPEND = coin->endPEND = 1; #endif coin->enableCACHE = 0;//(strcmp("BTC",coin->symbol) != 0); if ( jobj(json,"cache") != 0 ) diff --git a/iguana/iguana_ramchain.c b/iguana/iguana_ramchain.c index 644940dee..e45436242 100755 --- a/iguana/iguana_ramchain.c +++ b/iguana/iguana_ramchain.c @@ -429,26 +429,32 @@ uint32_t iguana_ramchain_addspend(struct iguana_info *coin,RAMCHAIN_FUNC,bits256 } //txidind |= (1 << 31); } - else if ( ptr != 0 ) + else { - txidind = ptr->hh.itemind; - if ( prev_vout >= 0 && (txidind & (1<<31)) == 0 ) + if ( vout >= 0 ) { - if ( txidind > 0 && txidind < ramchain->H.data->numtxids ) + if ( ptr != 0 ) { - if ( (unspentind= T[txidind].firstvout + prev_vout) > 0 && unspentind < ramchain->H.data->numunspents ) + txidind = ptr->hh.itemind; + if ( prev_vout >= 0 && (txidind & (1<<31)) == 0 ) { - value = Ux[unspentind].value; - if ( (pkind= Ux[unspentind].pkind) == 0 || pkind >= ramchain->H.data->numpkinds ) + if ( txidind > 0 && txidind < ramchain->H.data->numtxids ) { - printf("spendind.%d -> unspendind.%d %.8f -> pkind.0x%x\n",spendind,unspentind,dstr(value),pkind); - return(0); - } - } else printf("addspend illegal unspentind.%d vs %d\n",unspentind,ramchain->H.data->numunspents); - } else printf("addspend illegal txidind.%d vs %d\n",txidind,ramchain->H.data->numtxids), exit(-1); + if ( (unspentind= T[txidind].firstvout + prev_vout) > 0 && unspentind < ramchain->H.data->numunspents ) + { + value = Ux[unspentind].value; + if ( (pkind= Ux[unspentind].pkind) == 0 || pkind >= ramchain->H.data->numpkinds ) + { + printf("spendind.%d -> unspendind.%d %.8f -> pkind.0x%x\n",spendind,unspentind,dstr(value),pkind); + return(0); + } + } else printf("addspend illegal unspentind.%d vs %d\n",unspentind,ramchain->H.data->numunspents); + } else printf("addspend illegal txidind.%d vs %d\n",txidind,ramchain->H.data->numtxids), exit(-1); + } + } + else printf("unexpected addpsend case: null ptr.%p [%d] s%u\n",ptr,hdrsi,spendind); } } - else printf("unexpected addpsend case: null ptr s%u\n",spendind); if ( ramchain->H.ROflag != 0 ) { iguana_ramchain_txid(coin,RAMCHAIN_ARG,&txid,s);