Browse Source

Merge pull request #819 from jl777/jl777

fix bestmatches calc for printout
pass-iguana-arg
jl777 7 years ago
committed by GitHub
parent
commit
b9db07a187
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 10
      iguana/dpow/dpow_network.c

10
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 ( ((1LL << i) & masks[besti]) != 0 )
{ {
if ( bp->notaries[i].bestmask == masks[i] ) if ( bp->notaries[i].bestmask == masks[besti] )
bestmatches++; bestmatches++;
} }
} }
@ -1964,10 +1964,12 @@ void dpow_nanoutxoget(struct supernet_info *myinfo,struct dpow_info *dp,struct d
} }
else 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); 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 ( 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].recvmask = np->recvmask;
bp->recv[senderind].bestk = np->bestk; bp->recv[senderind].bestk = np->bestk;
bp->recv[senderind].bestmask = np->bestmask; bp->recv[senderind].bestmask = np->bestmask;
@ -1981,9 +1983,9 @@ 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); 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); //dpow_bestmask_update(myinfo,dp,bp,nn_senderind,nn_bestk,nn_bestmask,nn_recvmask);

Loading…
Cancel
Save