Browse Source

test

etomic
jl777 8 years ago
parent
commit
eef16ebd67
  1. 8
      iguana/dpow/dpow_network.c
  2. 2
      iguana/dpow/dpow_tx.c

8
iguana/dpow/dpow_network.c

@ -598,14 +598,14 @@ void dpow_bestconsensus(struct dpow_block *bp)
}
if ( besti >= 0 && bestks[besti] >= 0 && masks[besti] != 0 && (bp->recvmask & masks[besti]) == masks[besti] )
bp->bestmask = masks[besti], bp->bestk = bestks[besti];
if ( bp->bestmask == 0 || (time(NULL) / 100) != bp->lastepoch )
if ( bp->bestmask == 0 || (time(NULL) / 180) != bp->lastepoch )
{
bp->bestmask = dpow_notarybestk(bp->recvmask,bp,&bp->bestk);
if ( (time(NULL) / 60) != bp->lastepoch )
if ( (time(NULL) / 180) != bp->lastepoch )
{
bp->lastepoch = (uint32_t)(time(NULL) / 60);
bp->lastepoch = (uint32_t)(time(NULL) / 180);
printf("epoch %u\n",bp->lastepoch % bp->numnotaries);
sleep(2 + (rand() % 7));
sleep(1 + (rand() % 3));
}
}
}

2
iguana/dpow/dpow_tx.c

@ -106,7 +106,7 @@ uint64_t dpow_notarybestk(uint64_t refmask,struct dpow_block *bp,int8_t *lastkp)
*lastkp = -1;
for (m=j=0; j<bp->numnotaries; j++)
{
k = (j + ((uint32_t)time(NULL) / 60)) % bp->numnotaries;
k = (j + ((uint32_t)time(NULL) / 180)) % bp->numnotaries;
if ( bp->require0 != 0 && k == 0 )
continue;
if ( bits256_nonz(bp->notaries[k].src.prev_hash) != 0 && bits256_nonz(bp->notaries[k].dest.prev_hash) != 0 )

Loading…
Cancel
Save