From 0f2cd921176ad3e0c2a41b231dc341aa5d7ee8e4 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 5 Jun 2016 06:32:21 -0300 Subject: [PATCH] test --- iguana/coins/btcd | 2 +- iguana/iguana_spendvectors.c | 2 +- iguana/iguana_tx.c | 6 +++--- iguana/iguana_txidfind.c | 2 +- iguana/iguana_unspents.c | 6 +++--- iguana/iguana_volatiles.c | 2 +- 6 files changed, 10 insertions(+), 10 deletions(-) diff --git a/iguana/coins/btcd b/iguana/coins/btcd index e66dc1b47..ed7bbb59b 100755 --- a/iguana/coins/btcd +++ b/iguana/coins/btcd @@ -1 +1 @@ -curl --url "http://127.0.0.1:7778" --data "{\"prefetchlag\":-1,\"poll\":10,\"active\":1,\"agent\":\"iguana\",\"method\":\"addcoin\",\"newcoin\":\"BTCD\",\"startpend\":128,\"endpend\":64,\"services\":129,\"maxpeers\":256,\"RELAY\":1,\"VALIDATE\":1,\"portp2p\":14631}" +curl --url "http://127.0.0.1:7778" --data "{\"prefetchlag\":-1,\"poll\":10,\"active\":1,\"agent\":\"iguana\",\"method\":\"addcoin\",\"newcoin\":\"BTCD\",\"startpend\":18,\"endpend\":4,\"services\":129,\"maxpeers\":256,\"RELAY\":1,\"VALIDATE\":1,\"portp2p\":14631}" diff --git a/iguana/iguana_spendvectors.c b/iguana/iguana_spendvectors.c index f56c40949..ff6f35d3b 100755 --- a/iguana/iguana_spendvectors.c +++ b/iguana/iguana_spendvectors.c @@ -539,7 +539,7 @@ int32_t iguana_balancegen(struct iguana_info *coin,int32_t incremental,struct ig { if ( 0 && bp == coin->current ) printf("[%d] spendind.%u -> [%d] u%d\n",bp->hdrsi,spendind,spent_hdrsi,spent_unspentind); - if ( iguana_volatileupdate(coin,incremental,spentbp == coin->current ? &coin->RTramchain : &spentbp->ramchain,spent_hdrsi,spent_unspentind,spent_pkind,spent_value,spendind,h) < 0 ) + if ( iguana_volatileupdate(coin,incremental,&spentbp->ramchain,spent_hdrsi,spent_unspentind,spent_pkind,spent_value,spendind,h) < 0 ) //spentbp == coin->current ? &coin->RTramchain : errs++; } else //if ( Xspendinds != 0 ) diff --git a/iguana/iguana_tx.c b/iguana/iguana_tx.c index 7a7490e21..f29732cce 100755 --- a/iguana/iguana_tx.c +++ b/iguana/iguana_tx.c @@ -72,7 +72,7 @@ int32_t iguana_vinset(struct iguana_info *coin,uint8_t *scriptspace,int32_t heig memset(vin,0,sizeof(*vin)); if ( height >= 0 && height < coin->chain->bundlesize*coin->bundlescount && (bp= coin->bundles[height / coin->chain->bundlesize]) != 0 ) { - ramchain = (bp == coin->current) ? &coin->RTramchain : &bp->ramchain; + ramchain = &bp->ramchain;//(bp == coin->current) ? &coin->RTramchain : &bp->ramchain; if ( (rdata= ramchain->H.data) != 0 && i < rdata->numspends ) { S = RAMCHAIN_PTR(rdata,Soffset); @@ -125,7 +125,7 @@ int32_t iguana_voutset(struct iguana_info *coin,uint8_t *scriptspace,char *asmst memset(vout,0,sizeof(*vout)); if ( height >= 0 && height < coin->chain->bundlesize*coin->bundlescount && (bp= coin->bundles[height / coin->chain->bundlesize]) != 0 ) { - ramchain = (bp == coin->current) ? &coin->RTramchain : &bp->ramchain; + ramchain = &bp->ramchain;//(bp == coin->current) ? &coin->RTramchain : &bp->ramchain; if ( (rdata= ramchain->H.data) != 0 && i < tx->numvouts ) { U = RAMCHAIN_PTR(rdata,Uoffset); @@ -139,7 +139,7 @@ int32_t iguana_voutset(struct iguana_info *coin,uint8_t *scriptspace,char *asmst vout->value = u->value; vout->pk_script = scriptspace; scriptlen = iguana_voutscript(coin,bp,scriptspace,asmstr,u,&P[u->pkind],i); - } else printf("iguana_voutset unexpected path rdata.%p i.%d %d\n",rdata,i,tx->numvouts); + } else printf("iguana_voutset unexpected path [%d] rdata.%p i.%d %d\n",bp->hdrsi,rdata,i,tx->numvouts); } else printf("vout error getting rdata.%p height.%d\n",rdata,height); vout->pk_scriptlen = scriptlen; if ( err != 0 ) diff --git a/iguana/iguana_txidfind.c b/iguana/iguana_txidfind.c index feef01054..bd0bf3698 100755 --- a/iguana/iguana_txidfind.c +++ b/iguana/iguana_txidfind.c @@ -277,7 +277,7 @@ struct iguana_txid *iguana_txidfind(struct iguana_info *coin,int32_t *heightp,st { if ( (bp= coin->bundles[i]) != 0 && (bp == coin->current || bp->emitfinish > 1) ) { - ramchain = (bp == coin->current) ? &coin->RTramchain : &bp->ramchain; + ramchain = &bp->ramchain;//(bp == coin->current) ? &coin->RTramchain : &bp->ramchain; if ( (rdata= ramchain->H.data) != 0 ) { if ( (TXbits= ramchain->txbits) == 0 ) diff --git a/iguana/iguana_unspents.c b/iguana/iguana_unspents.c index 614ecfa73..78b29bf6f 100755 --- a/iguana/iguana_unspents.c +++ b/iguana/iguana_unspents.c @@ -41,7 +41,7 @@ int32_t iguana_unspentindfind(struct iguana_info *coin,char *coinaddr,uint8_t *s if ( pkind > 0 && pkind < rdata->numpkinds ) { RTspend = 0; - if ( iguana_spentflag(coin,&RTspend,&spentheight,bp == coin->current ? &coin->RTramchain : &bp->ramchain,bp->hdrsi,unspentind,0,1,coin->longestchain,U[unspentind].value) == 0 ) + if ( iguana_spentflag(coin,&RTspend,&spentheight,&bp->ramchain,bp->hdrsi,unspentind,0,1,coin->longestchain,U[unspentind].value) == 0 ) //bp == coin->current ? &coin->RTramchain : { if ( valuep != 0 ) *valuep = U[unspentind].value; @@ -410,7 +410,7 @@ int32_t iguana_uvaltxid(struct supernet_info *myinfo,bits256 *txidp,struct iguan struct iguana_bundle *bp; struct iguana_unspent *U,*u; struct iguana_txid *T; struct iguana_ramchain *ramchain; struct iguana_ramchaindata *rdata; if ( (bp= coin->bundles[hdrsi]) == 0 ) return(-1); - ramchain = (bp == coin->current) ? &coin->RTramchain : &bp->ramchain; + ramchain = &bp->ramchain;//(bp == coin->current) ? &coin->RTramchain : &bp->ramchain; if ( (rdata= ramchain->H.data) != 0 ) { U = RAMCHAIN_PTR(rdata,Uoffset); @@ -435,7 +435,7 @@ int64_t iguana_unspentavail(struct iguana_info *coin,uint64_t hdrsi_unspentind,i return(-1); hdrsi = (int16_t)(hdrsi_unspentind >> 32); unspentind = (uint32_t)hdrsi_unspentind; - ramchain = (bp == coin->current) ? &coin->RTramchain : &bp->ramchain; + ramchain = &bp->ramchain;//(bp == coin->current) ? &coin->RTramchain : &bp->ramchain; if ( (rdata= ramchain->H.data) == 0 ) return(0); if ( (spentflag= iguana_spentflag(coin,&RTspend,&spentheight,ramchain,hdrsi,unspentind,0,minconf,maxconf,0)) > 0 ) diff --git a/iguana/iguana_volatiles.c b/iguana/iguana_volatiles.c index 8c76e2d5f..0c3ba50b7 100755 --- a/iguana/iguana_volatiles.c +++ b/iguana/iguana_volatiles.c @@ -88,7 +88,7 @@ struct iguana_utxo iguana_utxofind(struct iguana_info *coin,int16_t spent_hdrsi, memset(&utxo,0,sizeof(utxo)); if ( (bp= coin->bundles[spent_hdrsi]) == 0 ) return(utxo); - ramchain = (bp == coin->current) ? &coin->RTramchain : &bp->ramchain; + ramchain = &bp->ramchain;//(bp == coin->current) ? &coin->RTramchain : &bp->ramchain; if ( (rdata= ramchain->H.data) == 0 ) return(utxo); val = ((uint64_t)spent_hdrsi << 32) | spent_unspentind;