jl777 8 years ago
parent
commit
c0b8995e68
  1. 4
      iguana/iguana777.c
  2. 31
      iguana/iguana_notary.c

4
iguana/iguana777.c

@ -735,7 +735,7 @@ void iguana_helper(void *arg)
{
if ( coin->firstRTheight == 0 )
{
if ( coin->spendvectorsaved == 1 && coin->chain->zcash == 0 )
if ( coin->spendvectorsaved == 1 )//&& coin->chain->zcash == 0 )
iguana_utxogen(myinfo,coin,helperid,1);
else if ( coin->spendvectorsaved > 1 && (coin->spendvalidated & (1 << helperid)) == 0 )
{
@ -764,7 +764,7 @@ void iguana_helper(void *arg)
if ( i == j )
{
iguana_bundlevalidate(myinfo,coin,bp,0);
if ( bp->validated > 1 && coin->chain->zcash == 0 )
if ( bp->validated > 1 )//&& coin->chain->zcash == 0 )
{
for (i=0; i<j; i++)
if ( coin->bundles[i] == 0 || coin->bundles[i]->utxofinish <= 1 )

31
iguana/iguana_notary.c

@ -32,7 +32,7 @@ int32_t dpow_datahandler(struct supernet_info *myinfo,struct dpow_info *dp,uint3
void dpow_fifoupdate(struct supernet_info *myinfo,struct dpow_checkpoint *fifo,struct dpow_checkpoint tip)
{
int32_t i,ind; struct dpow_checkpoint newfifo[DPOW_FIFOSIZE]; char str[65];
int32_t i,ind; struct dpow_checkpoint newfifo[DPOW_FIFOSIZE];
memset(newfifo,0,sizeof(newfifo));
for (i=DPOW_FIFOSIZE-1; i>0; i--)
{
@ -43,9 +43,9 @@ void dpow_fifoupdate(struct supernet_info *myinfo,struct dpow_checkpoint *fifo,s
}
newfifo[0] = tip;
memcpy(fifo,newfifo,sizeof(newfifo));
for (i=0; i<DPOW_FIFOSIZE; i++)
printf("%d ",bits256_nonz(fifo[i].blockhash.hash));
printf(" <- fifo %s\n",bits256_str(str,tip.blockhash.hash));
//for (i=0; i<DPOW_FIFOSIZE; i++)
// printf("%d ",bits256_nonz(fifo[i].blockhash.hash));
//printf(" <- fifo %s\n",bits256_str(str,tip.blockhash.hash));
}
void dpow_checkpointset(struct supernet_info *myinfo,struct dpow_checkpoint *checkpoint,int32_t height,bits256 hash,uint32_t timestamp,uint32_t blocktime)
@ -58,17 +58,27 @@ void dpow_checkpointset(struct supernet_info *myinfo,struct dpow_checkpoint *che
void dpow_srcupdate(struct supernet_info *myinfo,struct dpow_info *dp,int32_t height,bits256 hash,uint32_t timestamp,uint32_t blocktime)
{
void **ptrs; char str[65]; struct dpow_checkpoint checkpoint;
void **ptrs; char str[65]; struct dpow_checkpoint checkpoint; int32_t freq,minsigs;
dpow_checkpointset(myinfo,&dp->last,height,hash,timestamp,blocktime);
checkpoint = dp->srcfifo[dp->srcconfirms];
printf("%s srcupdate ht.%d destupdated.%u nonz.%d %s\n",dp->symbol,height,dp->destupdated,bits256_nonz(checkpoint.blockhash.hash),bits256_str(str,dp->last.blockhash.hash));
if ( strcmp("BTC",dp->dest) == 0 )
{
freq = DPOW_CHECKPOINTFREQ;
minsigs = DPOW_MINSIGS;
}
else
{
freq = 1;
minsigs = 2;
}
printf("%s src ht.%d dest.%u nonz.%d %s\n",dp->symbol,height,dp->destupdated,bits256_nonz(checkpoint.blockhash.hash),bits256_str(str,dp->last.blockhash.hash));
dpow_fifoupdate(myinfo,dp->srcfifo,dp->last);
if ( bits256_nonz(checkpoint.blockhash.hash) != 0 && (checkpoint.blockhash.height % DPOW_CHECKPOINTFREQ) == 0 )
if ( bits256_nonz(checkpoint.blockhash.hash) != 0 && (checkpoint.blockhash.height % freq) == 0 )
{
ptrs = calloc(1,sizeof(void *)*5 + sizeof(struct dpow_checkpoint));
ptrs[0] = (void *)myinfo;
ptrs[1] = (void *)dp;
ptrs[2] = (void *)DPOW_MINSIGS;
ptrs[2] = (void *)(uint64_t)minsigs;
ptrs[3] = (void *)DPOW_DURATION;
ptrs[4] = 0;
memcpy(&ptrs[5],&checkpoint,sizeof(checkpoint));
@ -121,10 +131,7 @@ void dpow_destupdate(struct supernet_info *myinfo,struct dpow_info *dp,int32_t h
dpow_fifoupdate(myinfo,dp->destfifo,dp->destchaintip);
if ( strcmp(dp->dest,"BTC") == 0 )
dpow_destconfirm(myinfo,dp,&dp->destfifo[DPOW_BTCCONFIRMS]);
else
{
dpow_destconfirm(myinfo,dp,&dp->destfifo[DPOW_KOMODOCONFIRMS * 2]); // todo: change to notarized KMD depth
}
else dpow_destconfirm(myinfo,dp,&dp->destfifo[DPOW_KOMODOCONFIRMS]); // todo: change to notarized KMD depth
}
void iguana_dPoWupdate(struct supernet_info *myinfo,struct dpow_info *dp)

Loading…
Cancel
Save