jl777 8 years ago
parent
commit
c7c9955004
  1. 7
      iguana/iguana_notary.c

7
iguana/iguana_notary.c

@ -721,15 +721,16 @@ void dpow_statemachinestart(void *ptr)
void dpow_fifoupdate(struct supernet_info *myinfo,struct dpow_checkpoint *fifo,struct dpow_checkpoint tip) void dpow_fifoupdate(struct supernet_info *myinfo,struct dpow_checkpoint *fifo,struct dpow_checkpoint tip)
{ {
int32_t i,offset; struct dpow_checkpoint newfifo[DPOW_FIFOSIZE]; int32_t i; struct dpow_checkpoint newfifo[DPOW_FIFOSIZE];
memset(newfifo,0,sizeof(newfifo)); memset(newfifo,0,sizeof(newfifo));
for (i=DPOW_FIFOSIZE-1; i>0; i--) for (i=DPOW_FIFOSIZE-1; i>0; i--)
{ {
if ( (offset= (tip.blockhash.height - fifo[i].blockhash.height)) >= 0 && offset < DPOW_FIFOSIZE ) /*if ( (offset= (tip.blockhash.height - fifo[i].blockhash.height)) >= 0 && offset < DPOW_FIFOSIZE )
{ {
newfifo[offset] = fifo[i]; newfifo[offset] = fifo[i];
} }
printf("[offset %d = (%d - %d)] <- i.%d\n",offset,tip.blockhash.height,fifo[i].blockhash.height,i); printf("[offset %d = (%d - %d)] <- i.%d\n",offset,tip.blockhash.height,fifo[i].blockhash.height,i);*/
newfifo[i] = fifo[i-1];
} }
newfifo[0] = tip; newfifo[0] = tip;
memcpy(fifo,newfifo,sizeof(newfifo)); memcpy(fifo,newfifo,sizeof(newfifo));

Loading…
Cancel
Save