Browse Source

test

release/v0.1
jl777 9 years ago
parent
commit
bfc5dc45b1
  1. 4
      iguana/iguana777.c
  2. 32
      iguana/iguana_ramchain.c

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

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

Loading…
Cancel
Save