Browse Source

test

release/v0.1
jl777 9 years ago
parent
commit
398187ccd3
  1. 10
      iguana/iguana_ramchain.c
  2. 4
      iguana/iguana_unspents.c

10
iguana/iguana_ramchain.c

@ -202,6 +202,11 @@ uint32_t iguana_ramchain_addtxid(struct iguana_info *coin,RAMCHAIN_FUNC,bits256
printf("iguana_ramchain_addtxid error adding txidind\n");
return(0);
}
if ( ptr->hh.itemind != txidind )
{
printf("iguana_ramchain_addtxid error adding txidind.%u vs %u\n",txidind,ptr->hh.itemind);
return(0);
}
}
return(txidind);
}
@ -408,7 +413,8 @@ uint32_t iguana_ramchain_addspend(struct iguana_info *coin,RAMCHAIN_FUNC,bits256
spendind = ramchain->H.spendind++;
s = &Sx[spendind];
pkind = unspentind = 0;
if ( prev_vout >= 0 && (ptr= iguana_hashfind(ramchain,'T',prev_hash.bytes)) == 0 )
ptr = iguana_hashfind(ramchain,'T',prev_hash.bytes);
if ( prev_vout >= 0 && ptr == 0 )
{
external = 1;
txidind = ramchain->externalind++;
@ -478,7 +484,7 @@ uint32_t iguana_ramchain_addspend(struct iguana_info *coin,RAMCHAIN_FUNC,bits256
// printf("%02x",vinscript[i]);
//printf(" SAVE vinscript len.%d\n",vinscriptlen);
if ( bits256_cmp(prev_hash,bits256_conv("d9151f0471a3982778c8acc623becc24bc35483bdecb07611d036209da541cde")) == 0 )
printf("found spend d9151... txidind.%u u%u [%d] s%u\n",txidind,unspentind,hdrsi,spendind);
printf("found spend d9151... txidind.%u (first.%u + vout.%d) u%u [%d] s%u\n",txidind,T[txidind].firstvout,prev_vout,unspentind,hdrsi,spendind);
s->sequenceid = sequence;
s->external = external, s->spendtxidind = txidind,
s->prevout = prev_vout;

4
iguana/iguana_unspents.c

@ -312,7 +312,7 @@ int32_t iguana_volatileupdate(struct iguana_info *coin,int32_t incremental,struc
if ( utxo->spentflag == 0 )
{
//if ( 0 && fromheight/coin->chain->bundlesize >= coin->current->hdrsi )
if ( (spent_hdrsi == 200 && spent_pkind == 1534811) || (spent_hdrsi == 202 && spent_pkind == 147416) )
if ( fromheight/coin->chain->bundlesize == 202 && (spendind == 3163977 || spendind == 4033628) )
printf("iguana_volatileupdate.%d: [%d] spent.(u%u %.8f pkind.%d) fromht.%d [%d] spendind.%d\n",incremental,spent_hdrsi,spent_unspentind,dstr(spent_value),spent_pkind,fromheight,fromheight/coin->chain->bundlesize,spendind);
utxo->prevunspentind = A2[spent_pkind].lastunspentind;
utxo->spentflag = 1;
@ -1273,7 +1273,7 @@ int32_t iguana_balancegen(struct iguana_info *coin,int32_t incremental,struct ig
//found spend d9151... txidind.1083097 [202] s3163977
//found spend d9151... txidind.1083097 [202] s4033628
if ( spent_hdrsi == 202 && (spendind == 3163977 || spendind == 4033628) )
printf("internal spend.%d txidind.%d 1st.%d U.(prevout.%d u%u pkind.%u %.8f)\n",spendind,txidind,T[txidind].firstvout,s->prevout,spent_unspentind,u->pkind,dstr(u->value));
printf("internal spend.%d spendtxidind.%d 1st.%d U.(prevout.%d u%u pkind.%u %.8f)\n",spendind,txidind,T[s->spendtxidind].firstvout,s->prevout,spent_unspentind,u->pkind,dstr(u->value));
}
else //if ( i > 0 || j > 0 || k > 0 )
{

Loading…
Cancel
Save