diff --git a/iguana/dPoW.h b/iguana/dPoW.h index 7ceb304b1..da8db86e2 100755 --- a/iguana/dPoW.h +++ b/iguana/dPoW.h @@ -51,6 +51,8 @@ #define PUB_SOCK 7773 #define REP_SOCK 7772 +#define DPOW_EPOCHDURATION 600 + struct dpow_coinentry { bits256 prev_hash; diff --git a/iguana/dpow/dpow_network.c b/iguana/dpow/dpow_network.c index dd19d55b5..ca093a82f 100755 --- a/iguana/dpow/dpow_network.c +++ b/iguana/dpow/dpow_network.c @@ -902,12 +902,12 @@ void dpow_ratify_update(struct supernet_info *myinfo,struct dpow_info *dp,struct if ( besti >= 0 && bestks[besti] >= 0 && masks[besti] != 0 && (bp->ratifyrecvmask & masks[besti]) == masks[besti] ) bp->ratifybestmask = masks[besti], bp->ratifybestk = bestks[besti]; //printf("numdiff.%d besti.%d numbest.%d (%d %llx) vs (%d %llx)\n",numdiff,besti,best,besti>=0?bestks[besti]:-1,(long long)(besti>=0?masks[besti]:0),bestk,(long long)bestmask); - if ( bp->ratifybestmask == 0 || (time(NULL) / 100) != bp->lastepoch ) + if ( bp->ratifybestmask == 0 || (time(NULL) / DPOW_EPOCHDURATION) != bp->lastepoch ) { bp->ratifybestmask = dpow_ratifybest(bp->ratifyrecvmask,bp,&bp->ratifybestk); - if ( (time(NULL) / 100) != bp->lastepoch ) + if ( (time(NULL) / DPOW_EPOCHDURATION) != bp->lastepoch ) { - bp->lastepoch = (uint32_t)(time(NULL) / 100); + bp->lastepoch = (uint32_t)(time(NULL) / DPOW_EPOCHDURATION); printf("epoch %u\n",bp->lastepoch % bp->numnotaries); sleep(2 + (rand() % 7)); } diff --git a/iguana/dpow/dpow_tx.c b/iguana/dpow/dpow_tx.c index e564aa895..abdce53ce 100755 --- a/iguana/dpow/dpow_tx.c +++ b/iguana/dpow/dpow_tx.c @@ -82,7 +82,7 @@ uint64_t dpow_ratifybest(uint64_t refmask,struct dpow_block *bp,int8_t *lastkp) *lastkp = -1; for (m=j=0; jnumnotaries; j++) { - k = (j + ((uint32_t)time(NULL) / 100)) % bp->numnotaries;//DPOW_MODIND(bp,j); + k = (j + ((uint32_t)time(NULL) / DPOW_EPOCHDURATION)) % bp->numnotaries;//DPOW_MODIND(bp,j); if ( bp->require0 != 0 && k == 0 ) continue; if ( bits256_nonz(bp->notaries[k].ratifysrcutxo) != 0 && bits256_nonz(bp->notaries[k].ratifydestutxo) != 0 )