|
|
@ -58,12 +58,13 @@ 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]; int32_t freq; struct dpow_checkpoint checkpoint; |
|
|
|
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)); |
|
|
|
dpow_fifoupdate(myinfo,dp->srcfifo,dp->last); |
|
|
|
if ( bits256_nonz(checkpoint.blockhash.hash) != 0 && (checkpoint.blockhash.height % DPOW_CHECKPOINTFREQ) == 0 ) |
|
|
|
freq = strcmp(dp->symbol,"KMD") == 0 ? DPOW_CHECKPOINTFREQ : 1; |
|
|
|
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; |
|
|
|