|
@ -232,17 +232,18 @@ void iguana_dPoWupdate(struct supernet_info *myinfo,struct dpow_info *dp) |
|
|
} else dpow_destupdate(myinfo,dp,height,blockhash,(uint32_t)time(NULL),blocktime); |
|
|
} else dpow_destupdate(myinfo,dp,height,blockhash,(uint32_t)time(NULL),blocktime); |
|
|
} // else printf("error getchaintip for %s\n",dp->dest);
|
|
|
} // else printf("error getchaintip for %s\n",dp->dest);
|
|
|
dp->numsrctx = sizeof(dp->srctx)/sizeof(*dp->srctx); |
|
|
dp->numsrctx = sizeof(dp->srctx)/sizeof(*dp->srctx); |
|
|
if ( (strcmp(dp->dest,"KMD") == 0 || strcmp(dp->dest,"CHAIN") == 0) && dp->SRCHEIGHT < src->longestchain ) |
|
|
/*if ( (strcmp(dp->dest,"KMD") == 0 || strcmp(dp->dest,"CHAIN") == 0) && dp->SRCHEIGHT < src->longestchain )
|
|
|
{ |
|
|
{ |
|
|
//fprintf(stderr,"[I ");
|
|
|
//fprintf(stderr,"[I ");
|
|
|
dp->SRCHEIGHT = dpow_issuer_iteration(dp,src,dp->SRCHEIGHT,&dp->SRCREALTIME); |
|
|
dp->SRCHEIGHT = dpow_issuer_iteration(dp,src,dp->SRCHEIGHT,&dp->SRCREALTIME); |
|
|
//fprintf(stderr," %d] ",dp->SRCHEIGHT);
|
|
|
//fprintf(stderr," %d] ",dp->SRCHEIGHT);
|
|
|
} |
|
|
}*/ |
|
|
if ( (height= dpow_getchaintip(myinfo,&merkleroot,&blockhash,&blocktime,dp->srctx,&dp->numsrctx,src)) != dp->last.blockhash.height && height > 0 ) |
|
|
if ( (height= dpow_getchaintip(myinfo,&merkleroot,&blockhash,&blocktime,dp->srctx,&dp->numsrctx,src)) != dp->last.blockhash.height && height > 0 ) |
|
|
{ |
|
|
{ |
|
|
char str[65]; printf("[%s].%d %s %s height.%d vs last.%d\n",dp->dest,dp->SRCHEIGHT,dp->symbol,bits256_str(str,blockhash),height,dp->last.blockhash.height); |
|
|
char str[65]; printf("[%s].%d %s %s height.%d vs last.%d\n",dp->dest,dp->SRCHEIGHT,dp->symbol,bits256_str(str,blockhash),height,dp->last.blockhash.height); |
|
|
if ( dp->lastheight == 0 ) |
|
|
if ( dp->lastheight == 0 ) |
|
|
dp->lastheight = height-1; |
|
|
dp->lastheight = height-1; |
|
|
|
|
|
dp->SRCHEIGHT = height; |
|
|
if ( height < dp->last.blockhash.height ) |
|
|
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); |
|
|
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); |
|
|