From 94473d4fedcaa353c5ac328fca67bde74cab10d8 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 17 May 2016 02:20:34 -0500 Subject: [PATCH] test --- iguana/iguana_tx.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/iguana/iguana_tx.c b/iguana/iguana_tx.c index 5ec1e0728..313c424e4 100755 --- a/iguana/iguana_tx.c +++ b/iguana/iguana_tx.c @@ -68,10 +68,11 @@ int32_t iguana_scriptdata(struct iguana_info *coin,uint8_t *scriptspace,long fil int32_t iguana_vinset(struct iguana_info *coin,uint8_t *scriptspace,int32_t height,struct iguana_msgvin *vin,struct iguana_txid *tx,int32_t i) { struct iguana_spend *s,*S; uint32_t spendind,unspentind; bits256 *X; struct iguana_bundle *bp; - struct iguana_ramchaindata *rdata; struct iguana_txid *T; char fname[1024]; int32_t scriptlen,err = 0; + struct iguana_ramchaindata *rdata=0; struct iguana_txid *T; char fname[1024]; int32_t scriptlen,err = 0; struct iguana_ramchain *ramchain; memset(vin,0,sizeof(*vin)); - if ( height >= 0 && height < coin->chain->bundlesize*coin->bundlescount && (bp= coin->bundles[height / coin->chain->bundlesize]) != 0 && (rdata= bp->ramchain.H.data) != 0 ) + 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; S = RAMCHAIN_PTR(rdata,Soffset); X = RAMCHAIN_PTR(rdata,Xoffset); T = RAMCHAIN_PTR(rdata,Toffset); @@ -91,7 +92,7 @@ int32_t iguana_vinset(struct iguana_info *coin,uint8_t *scriptspace,int32_t heig vin->scriptlen = s->scriptlen; vin->vinscript = scriptspace; iguana_ramchain_spendtxid(coin,&unspentind,&vin->prev_hash,T,rdata->numtxids,X,rdata->numexternaltxids,s); - } + } else printf("error getting rdata.%p height.%d\n",rdata,height); if ( err != 0 ) return(-err); else return(vin->scriptlen);