From 5de67f42338e10ac922bbd4bf383c4472f4559a1 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 10 Nov 2016 20:35:33 -0300 Subject: [PATCH] test --- iguana/dpow/dpow_fsm.c | 4 ++-- iguana/dpow/dpow_tx.c | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/iguana/dpow/dpow_fsm.c b/iguana/dpow/dpow_fsm.c index 15be1852d..456adf9cd 100755 --- a/iguana/dpow/dpow_fsm.c +++ b/iguana/dpow/dpow_fsm.c @@ -44,7 +44,7 @@ void dpow_ratify_update(struct supernet_info *myinfo,struct dpow_info *dp,struct bp->notaries[bp->myind].ratifybestk = bp->ratifybestk; for (i=0; inumnotaries; i++) { - if ( bp->notaries[i].ratifybestk == bp->ratifybestk && bp->notaries[i].ratifybestmask == bp->ratifybestmask ) + if ( bp->ratifybestk >= 0 && bp->notaries[i].ratifybestk == bp->ratifybestk && bp->notaries[i].ratifybestmask == bp->ratifybestmask ) { matches++; if ( ((1LL << i) & bp->ratifybestmask) != 0 ) @@ -62,7 +62,7 @@ void dpow_ratify_update(struct supernet_info *myinfo,struct dpow_info *dp,struct dpow_signedtxgen(myinfo,dp,bp->srccoin,bp,bp->pendingbestk,bp->pendingbestmask,bp->myind,DPOW_SIGCHANNEL,0,1); } } - printf("RATIFY.%d matches.%d bestmatches.%d bestk.%d %llx recv.%llx sigmasks.(%llx %llx)\n",bp->minsigs,matches,bestmatches,bp->ratifybestk,(long long)bp->ratifybestmask,(long long)bp->ratifyrecvmask,(long long)bp->ratifysigs[1],(long long)bp->ratifysigs[0]); + printf("RATIFY.%d matches.%d bestmatches.%d bestk.%d %llx recv.%llx sigmasks.(%llx %llx)\n",bp->minsigs,matches,bestmatches,bp->ratifybestk,(long long)bp->ratifybestmask,(long long)bp->ratifyrecvmask,(long long)bp->ratifysigmasks[1],(long long)bp->ratifysigmasks[0]); } } } diff --git a/iguana/dpow/dpow_tx.c b/iguana/dpow/dpow_tx.c index 66474b1bb..954ae812c 100755 --- a/iguana/dpow/dpow_tx.c +++ b/iguana/dpow/dpow_tx.c @@ -79,6 +79,7 @@ uint64_t dpow_ratifybest(uint64_t refmask,struct dpow_block *bp,int8_t *lastkp) { int32_t j,m,k; uint64_t bestmask,mask = bp->require0; bestmask = 0; + *lastkp = -1; m = bp->require0; for (j=0; jnumnotaries; j++) { @@ -100,6 +101,7 @@ uint64_t dpow_maskmin(uint64_t refmask,struct dpow_block *bp,int8_t *lastkp) { int32_t j,m,k; uint64_t bestmask,mask = bp->require0; bestmask = 0; + *lastkp = -1; m = bp->require0; for (j=0; jnumnotaries; j++) {