jl777 8 years ago
parent
commit
1354749725
  1. 2
      iguana/dPoW.h
  2. 16
      iguana/iguana_notary.c

2
iguana/dPoW.h

@ -125,7 +125,7 @@ struct dpow_info
struct dpow_hashheight approved[DPOW_FIFOSIZE],notarized[DPOW_FIFOSIZE];
bits256 srctx[DPOW_MAXTX],desttx[DPOW_MAXTX];
uint32_t SRCREALTIME,destupdated,srcconfirms,numdesttx,numsrctx,lastsplit,cancelratify,crcs[16];
int32_t maxblocks,SRCHEIGHT,SHORTFLAG;
int32_t lastheight,maxblocks,SRCHEIGHT,SHORTFLAG;
struct pax_transaction *PAX;
portable_mutex_t mutex;
uint32_t ipbits[64],numipbits;

16
iguana/iguana_notary.c

@ -165,6 +165,8 @@ void iguana_dPoWupdate(struct supernet_info *myinfo,struct dpow_info *dp)
if ( strcmp(dp->dest,"KMD") == 0 )
dp->SRCHEIGHT = dpow_issuer_iteration(dp,src,dp->SRCHEIGHT,&dp->SRCREALTIME);
char str[65]; printf("%s %s height.%d vs last.%d\n",dp->symbol,bits256_str(str,blockhash),height,dp->last.blockhash.height);
if ( dp->lastheight == 0 )
dp->lastheight = height-1;
if ( height < dp->last.blockhash.height )
{
printf("iguana_dPoWupdate src.%s reorg detected %d vs %d approved.%d notarized.%d\n",dp->symbol,height,dp->last.blockhash.height,dp->approved[0].height,dp->notarized[0].height);
@ -172,8 +174,18 @@ void iguana_dPoWupdate(struct supernet_info *myinfo,struct dpow_info *dp)
{
if ( bits256_cmp(blockhash,dp->last.blockhash.hash) != 0 )
printf("UNEXPECTED ILLEGAL BLOCK in src chaintip\n");
} else dpow_srcupdate(myinfo,dp,height,blockhash,(uint32_t)time(NULL),blocktime);
} else dpow_srcupdate(myinfo,dp,height,blockhash,(uint32_t)time(NULL),blocktime);
}
else
{
while ( dp->lastheight <= height )
dpow_srcupdate(myinfo,dp,dp->lastheight++,blockhash,(uint32_t)time(NULL),blocktime);
}
}
else
{
while ( dp->lastheight <= height )
dpow_srcupdate(myinfo,dp,dp->lastheight++,blockhash,(uint32_t)time(NULL),blocktime);
}
} //else printf("error getchaintip for %s\n",dp->symbol);
} else printf("iguana_dPoWupdate missing src.(%s) %p or dest.(%s) %p\n",dp->symbol,src,dp->dest,dest);
}

Loading…
Cancel
Save