Browse Source

test

etomic
jl777 8 years ago
parent
commit
f0c3d8e1c5
  1. 2
      iguana/dpow/dpow_fsm.c
  2. 13
      iguana/dpow/dpow_network.c
  3. 2
      iguana/dpow/dpow_tx.c

2
iguana/dpow/dpow_fsm.c

@ -36,7 +36,7 @@ void dpow_utxo2entry(struct dpow_block *bp,struct dpow_entry *ep,struct dpow_utx
bp->notaries[i].othermask |= up->othermasks[i];
ep->commit = up->commit;
ep->height = up->height;
ep->recvmask = up->recvmask;
ep->recvmask |= up->recvmask;
ep->bestk = up->bestk;
ep->src.prev_hash = up->srchash;
ep->dest.prev_hash = up->desthash;

13
iguana/dpow/dpow_network.c

@ -704,7 +704,7 @@ void dpow_notarize_update(struct supernet_info *myinfo,struct dpow_info *dp,stru
if ( bestmask != 0 )
bp->notaries[senderind].bestmask = bestmask;
if ( recvmask != 0 )
bp->notaries[senderind].recvmask = recvmask;
bp->notaries[senderind].recvmask |= recvmask;
if ( (bp->notaries[senderind].paxwdcrc= paxwdcrc) != 0 )
{
//fprintf(stderr,"{%d %x} ",senderind,paxwdcrc);
@ -741,7 +741,8 @@ void dpow_notarize_update(struct supernet_info *myinfo,struct dpow_info *dp,stru
bp->notaries[bp->myind].recvmask = bp->recvmask;
if ( bp->bestk >= 0 )
{
for (i=flag=0; i<bp->numnotaries; i++)
flag = -1;
for (i=0; i<bp->numnotaries; i++)
{
if ( bp->paxwdcrc == bp->notaries[i].paxwdcrc )
paxmatches++;
@ -757,12 +758,12 @@ void dpow_notarize_update(struct supernet_info *myinfo,struct dpow_info *dp,stru
} //else printf("?%x ",bp->notaries[i].paxwdcrc);
}
}
else if ( ((1LL << bp->myind) & bp->bestmask) != 0 && ((1LL << i) & bp->bestmask) != 0 && ((1LL << bp->myind) & bp->notaries[i].recvmask) == 0 )
flag++;
else if ( i == senderind && ((1LL << bp->myind) & bp->bestmask) != 0 && ((1LL << i) & bp->bestmask) != 0 && ((1LL << bp->myind) & bp->notaries[i].recvmask) == 0 )
flag = senderind;
if ( 0 && bp->myind <= 1 && bp->notaries[i].paxwdcrc != 0 )
printf("%d.(%x %d %llx r%llx) ",i,bp->notaries[i].paxwdcrc,bp->notaries[i].bestk,(long long)bp->notaries[i].bestmask,(long long)bp->notaries[i].recvmask);
}
if ( flag != 0 )
if ( flag >= 0 )
{
printf("flag.%d -> send\n",flag);
for (i=0; i<sizeof(srchash); i++)
@ -794,7 +795,7 @@ void dpow_notarize_update(struct supernet_info *myinfo,struct dpow_info *dp,stru
}
}
if ( (rand() % 30) == 0 )
printf("[%d] ips.%d %s NOTARIZE.%d matches.%d paxmatches.%d bestmatches.%d bestk.%d %llx recv.%llx sigmasks.(%llx %llx) senderind.%d state.%x (%x %x %x) pax.%x\n",bp->myind,dp->numipbits,dp->symbol,bp->minsigs,matches,paxmatches,bestmatches,bp->bestk,(long long)bp->bestmask,(long long)bp->recvmask,(long long)(bp->bestk>=0?bp->destsigsmasks[bp->bestk]:0),(long long)(bp->bestk>=0?bp->srcsigsmasks[bp->bestk]:0),senderind,bp->state,bp->hashmsg.uints[0],bp->desttxid.uints[0],bp->srctxid.uints[0],bp->paxwdcrc);
printf("%p [%d] ips.%d %s NOTARIZE.%d matches.%d paxmatches.%d bestmatches.%d bestk.%d %llx recv.%llx sigmasks.(%llx %llx) senderind.%d state.%x (%x %x %x) pax.%x\n",bp,bp->myind,dp->numipbits,dp->symbol,bp->minsigs,matches,paxmatches,bestmatches,bp->bestk,(long long)bp->bestmask,(long long)bp->recvmask,(long long)(bp->bestk>=0?bp->destsigsmasks[bp->bestk]:0),(long long)(bp->bestk>=0?bp->srcsigsmasks[bp->bestk]:0),senderind,bp->state,bp->hashmsg.uints[0],bp->desttxid.uints[0],bp->srctxid.uints[0],bp->paxwdcrc);
}
}

2
iguana/dpow/dpow_tx.c

@ -22,7 +22,7 @@ void dpow_bestmask_update(struct supernet_info *myinfo,struct dpow_info *dp,stru
return;
bp->notaries[nn_senderind].bestk = nn_bestk;
bp->notaries[nn_senderind].bestmask = nn_bestmask;
bp->notaries[nn_senderind].recvmask = nn_recvmask;
bp->notaries[nn_senderind].recvmask |= nn_recvmask;
startscore = bp->scores[nn_senderind];
if ( bp->bestk >= 0 )
{

Loading…
Cancel
Save