Browse Source

test

release/v0.1
jl777 9 years ago
parent
commit
d5093b8219
  1. 6
      gecko/gecko_miner.c
  2. 2
      iguana/iguana_instantdex.c
  3. 2
      iguana/iguana_ramchain.c
  4. 12
      iguana/iguana_realtime.c
  5. 8
      iguana/iguana_spendvectors.c
  6. 2
      iguana/iguana_unspents.c

6
gecko/gecko_miner.c

@ -101,7 +101,7 @@ uint32_t gecko_nBits(struct iguana_info *virt,uint32_t *prevtimestampp,struct ig
int32_t gecko_delayedPoW(struct supernet_info *myinfo,struct iguana_info *btcd,int32_t isPoS,uint8_t *coinbase,bits256 *btcdhashp,uint32_t timestamp,int32_t height) int32_t gecko_delayedPoW(struct supernet_info *myinfo,struct iguana_info *btcd,int32_t isPoS,uint8_t *coinbase,bits256 *btcdhashp,uint32_t timestamp,int32_t height)
{ {
int32_t len = 0; //bits256 btchash; int32_t len = 0; //bits256 btchash;
*btcdhashp = GENESIS_PUBKEY; memset(btcdhashp,0,sizeof(*btcdhashp));
len += iguana_rwnum(1,&coinbase[len],sizeof(height),(void *)&height); len += iguana_rwnum(1,&coinbase[len],sizeof(height),(void *)&height);
coinbase[len++] = 0; coinbase[len++] = 0;
if ( (isPoS & 7) != 0 ) if ( (isPoS & 7) != 0 )
@ -110,9 +110,9 @@ int32_t gecko_delayedPoW(struct supernet_info *myinfo,struct iguana_info *btcd,i
if ( (isPoS & 2) != 0 && (bits256_cmp(*btcdhashp,GENESIS_PUBKEY) == 0 || bits256_nonz(*btcdhashp) == 0) ) if ( (isPoS & 2) != 0 && (bits256_cmp(*btcdhashp,GENESIS_PUBKEY) == 0 || bits256_nonz(*btcdhashp) == 0) )
return(-1); return(-1);
if ( (isPoS & 4) != 0 && (bits256_cmp(btchash,GENESIS_PUBKEY) == 0 || bits256_nonz(btchash) == 0) ) if ( (isPoS & 4) != 0 && (bits256_cmp(btchash,GENESIS_PUBKEY) == 0 || bits256_nonz(btchash) == 0) )
return(-1); return(-1);*/
//len += iguana_rwbignum(1,&coinbase[len],sizeof(*btcdhashp),btcdhashp->bytes); //len += iguana_rwbignum(1,&coinbase[len],sizeof(*btcdhashp),btcdhashp->bytes);
len += iguana_rwbignum(1,&coinbase[len],sizeof(btchash),btchash.bytes);*/ //len += iguana_rwbignum(1,&coinbase[len],sizeof(btchash),btchash.bytes);
} }
return(len); return(len);
} }

2
iguana/iguana_instantdex.c

@ -1720,7 +1720,7 @@ TWO_STRINGS(InstantDEX,events,base,rel)
ZERO_ARGS(InstantDEX,allcoins) ZERO_ARGS(InstantDEX,allcoins)
{ {
return(clonestr("{\"result\":\"[\"BTC\", \"BTCD\", \"LTC\", \"SYS\", \"ZEC\"]\"}")); return(clonestr("{\"result\":[\"BTC\", \"BTCD\", \"LTC\", \"SYS\", \"ZEC\"]}"));
} }
STRING_ARG(InstantDEX,available,source) STRING_ARG(InstantDEX,available,source)

2
iguana/iguana_ramchain.c

@ -443,7 +443,7 @@ uint32_t iguana_ramchain_addspend(struct iguana_info *coin,RAMCHAIN_FUNC,bits256
s = &Sx[spendind]; s = &Sx[spendind];
pkind = unspentind = 0; pkind = unspentind = 0;
ptr = iguana_hashfind(ramchain,'T',prev_hash.bytes); ptr = iguana_hashfind(ramchain,'T',prev_hash.bytes);
if ( prev_vout >= 0 && ptr == 0 ) if ( (bits256_nonz(prev_hash) != 0 || prev_vout >= 0) && ptr == 0 )
{ {
external = 1; external = 1;
txidind = ramchain->externalind++; txidind = ramchain->externalind++;

12
iguana/iguana_realtime.c

@ -209,10 +209,6 @@ int32_t iguana_realtime_update(struct supernet_info *myinfo,struct iguana_info *
struct iguana_block *block=0; struct iguana_blockRO *B; struct iguana_ramchain *dest=0,blockR; struct iguana_block *block=0; struct iguana_blockRO *B; struct iguana_ramchain *dest=0,blockR;
if ( coin->peers == 0 && coin->virtualchain == 0 ) if ( coin->peers == 0 && coin->virtualchain == 0 )
return(0); return(0);
if ( coin->virtualchain != 0 )
{
;
}
offset = (strcmp("BTCD",coin->symbol) == 0); offset = (strcmp("BTCD",coin->symbol) == 0);
if ( coin->current != 0 && (coin->blocks.hwmchain.height % coin->chain->bundlesize) == coin->chain->bundlesize-1 && coin->blocks.hwmchain.height/coin->chain->bundlesize == coin->longestchain/coin->chain->bundlesize ) if ( coin->current != 0 && (coin->blocks.hwmchain.height % coin->chain->bundlesize) == coin->chain->bundlesize-1 && coin->blocks.hwmchain.height/coin->chain->bundlesize == coin->longestchain/coin->chain->bundlesize )
{ {
@ -283,14 +279,6 @@ int32_t iguana_realtime_update(struct supernet_info *myinfo,struct iguana_info *
{ {
iguana_RThdrs(coin,bp,coin->peers->numranked); iguana_RThdrs(coin,bp,coin->peers->numranked);
coin->RThdrstime = bp->lastRT; coin->RThdrstime = bp->lastRT;
for (i=0; i<coin->peers->numranked; i++)
{
if ( (addr= coin->peers->ranked[i]) != 0 && addr->usock >= 0 && addr->dead == 0 )
{
//printf("%d ",addr->numRThashes);
}
}
//printf("RTheaders %s\n",coin->symbol);
} }
bp->lastRT = (uint32_t)time(NULL); bp->lastRT = (uint32_t)time(NULL);
iguana_RTramchainalloc("RTbundle",coin,bp); iguana_RTramchainalloc("RTbundle",coin,bp);

8
iguana/iguana_spendvectors.c

@ -929,7 +929,7 @@ int32_t iguana_balanceflush(struct iguana_info *coin,int32_t refhdrsi)
int32_t iguana_spendvectorsaves(struct iguana_info *coin) int32_t iguana_spendvectorsaves(struct iguana_info *coin)
{ {
int32_t i,j,n,iter; struct iguana_bundle *bp; struct iguana_ramchain *ramchain; struct iguana_ramchaindata *rdata; int32_t i,j,n,iter; struct iguana_bundle *bp;
if ( coin->spendvectorsaved > 1 ) if ( coin->spendvectorsaved > 1 )
return(0); return(0);
coin->spendvectorsaved = 1; coin->spendvectorsaved = 1;
@ -941,8 +941,6 @@ int32_t iguana_spendvectorsaves(struct iguana_info *coin)
{ {
if ( (bp= coin->bundles[i]) != 0 ) if ( (bp= coin->bundles[i]) != 0 )
{ {
rdata = (bp == coin->current) ? bp->ramchain.H.data : coin->RTramchain.H.data;
ramchain = (bp == coin->current) ? &bp->ramchain : &coin->RTramchain;
if ( iter == 0 ) if ( iter == 0 )
{ {
if ( bp->tmpspends != 0 )//bp->ramchain.Xspendinds == 0 && if ( bp->tmpspends != 0 )//bp->ramchain.Xspendinds == 0 &&
@ -955,9 +953,9 @@ int32_t iguana_spendvectorsaves(struct iguana_info *coin)
} }
} }
} }
else if ( rdata != 0 && iguana_spendvectorsave(coin,bp,ramchain,bp->tmpspends,bp->numtmpspends,rdata->numspends) == 0 ) else if ( iguana_spendvectorsave(coin,bp,&bp->ramchain,bp->tmpspends,bp->numtmpspends,bp->ramchain.H.data->numspends) == 0 )
{ {
if ( bp->tmpspends != 0 && bp->numtmpspends > 0 && bp->tmpspends != ramchain->Xspendinds ) if ( bp->tmpspends != 0 && bp->numtmpspends > 0 && bp->tmpspends != bp->ramchain.Xspendinds )
myfree(bp->tmpspends,sizeof(*bp->tmpspends) * bp->numtmpspends); myfree(bp->tmpspends,sizeof(*bp->tmpspends) * bp->numtmpspends);
bp->numtmpspends = 0; bp->numtmpspends = 0;
bp->tmpspends = 0; bp->tmpspends = 0;

2
iguana/iguana_unspents.c

@ -161,7 +161,7 @@ struct iguana_pkhash *iguana_pkhashfind(struct iguana_info *coin,struct iguana_r
printf("iguana_pkhashfind: unexpected access when RTramchain_busy\n"); printf("iguana_pkhashfind: unexpected access when RTramchain_busy\n");
return(0); return(0);
} }
ramchain = (bp != coin->current) ? &bp->ramchain : &coin->RTramchain; ramchain = &bp->ramchain;//(bp != coin->current) ? &bp->ramchain : &coin->RTramchain;
if ( (rdata= ramchain->H.data) != 0 ) if ( (rdata= ramchain->H.data) != 0 )
{ {
numpkinds = rdata->numpkinds; numpkinds = rdata->numpkinds;

Loading…
Cancel
Save