From b4a5e258cdf94e3c8a938ed45211c9436d27b23f Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 2 May 2018 19:31:02 +0300 Subject: [PATCH 1/2] Fix best calc --- iguana/dpow/dpow_network.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/iguana/dpow/dpow_network.c b/iguana/dpow/dpow_network.c index 704cf56aa..49ee18db2 100755 --- a/iguana/dpow/dpow_network.c +++ b/iguana/dpow/dpow_network.c @@ -1506,7 +1506,7 @@ void dpow_bestconsensus(struct dpow_info *dp,struct dpow_block *bp) { if ( ((1LL << i) & masks[besti]) != 0 ) { - if ( bp->notaries[i].bestmask == masks[i] ) + if ( bp->notaries[i].bestmask == masks[besti] ) bestmatches++; } } @@ -1964,10 +1964,12 @@ void dpow_nanoutxoget(struct supernet_info *myinfo,struct dpow_info *dp,struct d } else { - int32_t i,bestmatches=0,matches = 0; + int32_t i,bestmatches=0,matches = 0,dispflag = 0; dpow_notarize_update(myinfo,dp,bp,senderind,(int8_t)np->bestk,np->bestmask,np->recvmask,np->srcutxo,np->srcvout,np->destutxo,np->destvout,np->siglens,np->sigs,np->paxwdcrc); if ( np->bestk >= 0 ) { + if ( bp->recv[senderind].recvmask != np->recvmask || bp->recv[senderind].bestk != np->bestk || bp->recv[senderind].bestmask != np->bestmask ) + dispflag = 1; bp->recv[senderind].recvmask = np->recvmask; bp->recv[senderind].bestk = np->bestk; bp->recv[senderind].bestmask = np->bestmask; @@ -1981,7 +1983,7 @@ void dpow_nanoutxoget(struct supernet_info *myinfo,struct dpow_info *dp,struct d } } } - if ( bp->myind == 0 ) + if ( bp->myind == 0 && dispflag != 0 ) { printf("%s.%d lag.[%2d] %s RECV.%d %llx (%2d %llx) %llx/%llx matches.%d best.%d\n",dp->symbol,bp->height,(int32_t)(time(NULL)-channel),Notaries_elected[senderind][0],senderind,(long long)np->recvmask,(int8_t)np->bestk,(long long)np->bestmask,(long long)np->srcutxo.txid,(long long)np->destutxo.txid,matches,bestmatches); } From a43c20aa3983c77282e42550d225f13d0ce8f3e7 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 2 May 2018 19:33:23 +0300 Subject: [PATCH 2/2] Print --- iguana/dpow/dpow_network.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/dpow/dpow_network.c b/iguana/dpow/dpow_network.c index 49ee18db2..a649a337d 100755 --- a/iguana/dpow/dpow_network.c +++ b/iguana/dpow/dpow_network.c @@ -1985,7 +1985,7 @@ void dpow_nanoutxoget(struct supernet_info *myinfo,struct dpow_info *dp,struct d } if ( bp->myind == 0 && dispflag != 0 ) { - printf("%s.%d lag.[%2d] %s RECV.%d %llx (%2d %llx) %llx/%llx matches.%d best.%d\n",dp->symbol,bp->height,(int32_t)(time(NULL)-channel),Notaries_elected[senderind][0],senderind,(long long)np->recvmask,(int8_t)np->bestk,(long long)np->bestmask,(long long)np->srcutxo.txid,(long long)np->destutxo.txid,matches,bestmatches); + printf("%s.%d RECV.%-2d %llx (%2d %llx) %llx/%llx matches.%-2d best.%-2d %s\n",dp->symbol,bp->height,senderind,(long long)np->recvmask,(int8_t)np->bestk,(long long)np->bestmask,(long long)np->srcutxo.txid,(long long)np->destutxo.txid,matches,bestmatches,Notaries_elected[senderind][0]); } } //dpow_bestmask_update(myinfo,dp,bp,nn_senderind,nn_bestk,nn_bestmask,nn_recvmask);