Browse Source

test

release/v0.1
jl777 9 years ago
parent
commit
94473d4fed
  1. 7
      iguana/iguana_tx.c

7
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);

Loading…
Cancel
Save