From a2847aabd64c280f452f86e2953b4b4fce970d43 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 2 May 2018 13:43:29 +0300 Subject: [PATCH] Test --- iguana/dpow/dpow_tx.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/iguana/dpow/dpow_tx.c b/iguana/dpow/dpow_tx.c index f59e1268d..e1af6520e 100755 --- a/iguana/dpow/dpow_tx.c +++ b/iguana/dpow/dpow_tx.c @@ -101,9 +101,8 @@ uint64_t dpow_ratifybest(uint64_t refmask,struct dpow_block *bp,int8_t *lastkp) uint64_t dpow_notarybestk(uint64_t refmask,struct dpow_block *bp,int8_t *lastkp) { - int32_t m,j,k; uint64_t bestmask,mask = 0;//bp->require0; + int32_t m,j,k; int8_t bestk = -1; uint64_t bestmask,mask = 0;//bp->require0; bestmask = 0; - *lastkp = -1; for (m=j=0; jnumnotaries; j++) { //k = (j + ((uint32_t)time(NULL) / 180)) % bp->numnotaries; @@ -115,12 +114,14 @@ uint64_t dpow_notarybestk(uint64_t refmask,struct dpow_block *bp,int8_t *lastkp) mask |= (1LL << k); if ( ++m == bp->minsigs )//-bp->require0 ) { - *lastkp = k; + bestk = k; bestmask = mask;// | bp->require0; //printf("m.%d == minsigs.%d (%d %llx)\n",m,bp->minsigs,k,(long long)bestmask); } } } + if ( bestk >= 0 ) + *lastkp = bestk; return(bestmask); }