Browse Source

Merge pull request #170 from jl777/dev

Dev
win-cross
jl777 8 years ago
committed by GitHub
parent
commit
71835624aa
  1. 2
      iguana/dpow/dpow_fsm.c
  2. 10
      iguana/dpow/dpow_network.c

2
iguana/dpow/dpow_fsm.c

@ -412,7 +412,7 @@ void dpow_statemachinestart(void *ptr)
extralen = dpow_paxpending(extras,&bp->paxwdcrc); extralen = dpow_paxpending(extras,&bp->paxwdcrc);
bp->notaries[bp->myind].paxwdcrc = bp->paxwdcrc; bp->notaries[bp->myind].paxwdcrc = bp->paxwdcrc;
} }
sleep(3); sleep(5);
if ( dp->checkpoint.blockhash.height > checkpoint.blockhash.height ) if ( dp->checkpoint.blockhash.height > checkpoint.blockhash.height )
{ {
if ( bp->isratify == 0 ) if ( bp->isratify == 0 )

10
iguana/dpow/dpow_network.c

@ -1027,17 +1027,17 @@ void dpow_notarize_update(struct supernet_info *myinfo,struct dpow_info *dp,stru
} }
else if ( i == senderind && ((1LL << bp->myind) & bp->bestmask) != 0 && ((1LL << i) & bp->bestmask) != 0 && ((1LL << bp->myind) & bp->notaries[i].recvmask) == 0 ) 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; flag = senderind;
if ( 1 && bp->myind <= 1 && bp->notaries[i].paxwdcrc != 0 ) 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); 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); //printf("flag.%d -> send\n",flag);
for (i=0; i<sizeof(srchash); i++) for (i=0; i<sizeof(srchash); i++)
srchash.bytes[i] = dp->minerkey33[i+1]; srchash.bytes[i] = dp->minerkey33[i+1];
dpow_send(myinfo,dp,bp,srchash,bp->hashmsg,0,bp->height,(void *)"ping",0); dpow_send(myinfo,dp,bp,srchash,bp->hashmsg,0,bp->height,(void *)"ping",0);
} }
if ( 1 && bp->myind <= 1 ) if ( 0 && bp->myind <= 1 )
printf("recv.%llx best.(%d %llx) m.%d p.%d:%d b.%d\n",(long long)bp->recvmask,bp->bestk,(long long)bp->bestmask,matches,paxmatches,paxbestmatches,bestmatches); printf("recv.%llx best.(%d %llx) m.%d p.%d:%d b.%d\n",(long long)bp->recvmask,bp->bestk,(long long)bp->bestmask,matches,paxmatches,paxbestmatches,bestmatches);
if ( bestmatches >= bp->minsigs && paxbestmatches >= bp->minsigs ) if ( bestmatches >= bp->minsigs && paxbestmatches >= bp->minsigs )
{ {
@ -1061,7 +1061,7 @@ void dpow_notarize_update(struct supernet_info *myinfo,struct dpow_info *dp,stru
} //else printf("destmask.%llx != bestmask.%llx\n",(long long)bp->destsigsmasks[bp->bestk],(long long)bp->bestmask); } //else printf("destmask.%llx != bestmask.%llx\n",(long long)bp->destsigsmasks[bp->bestk],(long long)bp->bestmask);
} }
} }
if ( (rand() % 30) == 0 ) if ( (rand() % 130) == 0 )
printf("%p ht.%d [%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->height,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 ht.%d [%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->height,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);
} }
} }
@ -1236,7 +1236,7 @@ int32_t dpow_nanomsg_update(struct supernet_info *myinfo)
dpow_ipbitsadd(myinfo,dp,np->ipbits,np->numipbits,np->senderind,np->myipbits); dpow_ipbitsadd(myinfo,dp,np->ipbits,np->numipbits,np->senderind,np->myipbits);
if ( (bp= dpow_heightfind(myinfo,dp,np->height)) != 0 && bp->state != 0xffffffff && bp->myind >= 0 ) if ( (bp= dpow_heightfind(myinfo,dp,np->height)) != 0 && bp->state != 0xffffffff && bp->myind >= 0 )
{ {
char str[65]; printf("%s RECV ht.%d ch.%08x (%d) crc32.%08x:%08x datalen.%d:%d firstz.%d i.%d senderind.%d myind.%d\n",bits256_str(str,np->srchash),np->height,np->channel,size,np->crc32,crc32,np->datalen,(int32_t)(size - sizeof(*np)),firstz,i,np->senderind,bp->myind); //char str[65]; printf("%s RECV ht.%d ch.%08x (%d) crc32.%08x:%08x datalen.%d:%d firstz.%d i.%d senderind.%d myind.%d\n",bits256_str(str,np->srchash),np->height,np->channel,size,np->crc32,crc32,np->datalen,(int32_t)(size - sizeof(*np)),firstz,i,np->senderind,bp->myind);
if ( np->senderind >= 0 && np->senderind < bp->numnotaries ) if ( np->senderind >= 0 && np->senderind < bp->numnotaries )
{ {
if ( memcmp(bp->notaries[np->senderind].pubkey+1,np->srchash.bytes,32) == 0 && bits256_nonz(np->srchash) != 0 ) if ( memcmp(bp->notaries[np->senderind].pubkey+1,np->srchash.bytes,32) == 0 && bits256_nonz(np->srchash) != 0 )

Loading…
Cancel
Save