Browse Source

Stricter condition for signing

patch-5
jl777 7 years ago
parent
commit
5e7f13f3e9
  1. 27
      iguana/dpow/dpow_network.c

27
iguana/dpow/dpow_network.c

@ -1993,9 +1993,24 @@ void dpow_notarize_update(struct supernet_info *myinfo,struct dpow_info *dp,stru
{ {
//fprintf(stderr,"{%d %x} ",senderind,paxwdcrc); //fprintf(stderr,"{%d %x} ",senderind,paxwdcrc);
} }
bp->notaries[bp->myind].paxwdcrc = bp->paxwdcrc;
if ( bp->bestmask == 0 )
{
bp->recvmask |= (1LL << senderind) | (1LL << bp->myind);
bp->bestmask = dpow_maskmin(bp->recvmask,bp,&bp->bestk);
}
dpow_bestconsensus(dp,bp);
if ( bp->bestk >= 0 )
bp->notaries[bp->myind].bestk = bp->bestk;
if ( bp->bestmask != 0 )
bp->notaries[bp->myind].bestmask = bp->bestmask;
if ( bp->recvmask != 0 )
bp->notaries[bp->myind].recvmask = bp->recvmask;
if ( bestk >= 0 || bp->notaries[senderind].bestk < 0 ) if ( bestk >= 0 || bp->notaries[senderind].bestk < 0 )
{ {
bp->notaries[senderind].bestk = bestk; bp->notaries[senderind].bestk = bestk;
if ( bp->pendingbestk == bestk && bp->pendingbestmask == bp->bestmask )
{
if ( bp->notaries[senderind].src.siglens[bestk] == 0 && (bp->notaries[senderind].src.siglens[bestk]= siglens[0]) != 0 ) if ( bp->notaries[senderind].src.siglens[bestk] == 0 && (bp->notaries[senderind].src.siglens[bestk]= siglens[0]) != 0 )
{ {
memcpy(bp->notaries[senderind].src.sigs[bestk],sigs[0],siglens[0]); memcpy(bp->notaries[senderind].src.sigs[bestk],sigs[0],siglens[0]);
@ -2011,19 +2026,7 @@ void dpow_notarize_update(struct supernet_info *myinfo,struct dpow_info *dp,stru
else bp->destsigsmasks[bestk] &= ~(1LL << senderind); else bp->destsigsmasks[bestk] &= ~(1LL << senderind);
} }
} }
bp->notaries[bp->myind].paxwdcrc = bp->paxwdcrc;
if ( bp->bestmask == 0 )
{
bp->recvmask |= (1LL << senderind) | (1LL << bp->myind);
bp->bestmask = dpow_maskmin(bp->recvmask,bp,&bp->bestk);
} }
dpow_bestconsensus(dp,bp);
if ( bp->bestk >= 0 )
bp->notaries[bp->myind].bestk = bp->bestk;
if ( bp->bestmask != 0 )
bp->notaries[bp->myind].bestmask = bp->bestmask;
if ( bp->recvmask != 0 )
bp->notaries[bp->myind].recvmask = bp->recvmask;
if ( bp->bestk >= 0 ) if ( bp->bestk >= 0 )
{ {
flag = -1; flag = -1;

Loading…
Cancel
Save