Browse Source

test

etomic
jl777 8 years ago
parent
commit
31cd2079c5
  1. 1
      basilisk/basilisk.c
  2. 1
      iguana/dPoW.h
  3. 14
      iguana/dpow/dpow_network.c

1
basilisk/basilisk.c

@ -213,6 +213,7 @@ int32_t basilisk_sendcmd(struct supernet_info *myinfo,char *destipaddr,char *typ
return(-1);
}
//portable_mutex_lock(&myinfo->allcoins_mutex);
dex_reqsend(myinfo,&data[-(int32_t)sizeof(struct iguana_msghdr)],datalen);
alreadysent = calloc(IGUANA_MAXPEERS * IGUANA_MAXCOINS,sizeof(*alreadysent));
HASH_ITER(hh,myinfo->allcoins,coin,tmp)
{

1
iguana/dPoW.h

@ -141,5 +141,6 @@ struct dpow_info
uint64_t dpow_notarybestk(uint64_t refmask,struct dpow_block *bp,int8_t *lastkp);
int32_t dpow_paxpending(uint8_t *hex,uint32_t *paxwdcrcp);
void dex_updateclient(struct supernet_info *myinfo);
int32_t dex_reqsend(struct supernet_info *myinfo,uint8_t *data,int32_t datalen);
#endif

14
iguana/dpow/dpow_network.c

@ -56,7 +56,7 @@ static int _increasing_ipbits(const void *a,const void *b)
void dex_packet(struct supernet_info *myinfo,struct dex_nanomsghdr *dexp,int32_t size)
{
printf("DEX_PACKET.[%d] crc.%x lag.%d\n",size,calc_crc32(0,(void *)((long)dexp+sizeof(dexp->crc32)),(int32_t)(size-sizeof(dexp->crc32))),(int32_t)(time(NULL)-dexp->timestamp));
printf("uniq DEX_PACKET.[%d] crc.%x lag.%d\n",size,calc_crc32(0,(void *)((long)dexp+sizeof(dexp->crc32)),(int32_t)(size-sizeof(dexp->crc32))),(int32_t)(time(NULL)-dexp->timestamp));
}
int32_t dex_reqsend(struct supernet_info *myinfo,uint8_t *data,int32_t datalen)
@ -717,11 +717,13 @@ void dpow_notarize_update(struct supernet_info *myinfo,struct dpow_info *dp,stru
else bp->destsigsmasks[bestk] &= ~(1LL << senderind);
}
}
dpow_bestconsensus(bp);
//bp->recvmask |= (1LL << senderind) | (1LL << bp->myind);
//bp->bestmask = dpow_maskmin(bp->recvmask,bp,&bp->bestk);
//if ( bp->paxwdcrc != 0 )
bp->notaries[bp->myind].paxwdcrc = bp->paxwdcrc;
if ( (bp->notaries[bp->myind].paxwdcrc= bp->paxwdcrc) != 0 )
dpow_bestconsensus(bp);
else
{
bp->recvmask |= (1LL << senderind) | (1LL << bp->myind);
bp->bestmask = dpow_maskmin(bp->recvmask,bp,&bp->bestk);
}
if ( bp->bestk >= 0 )
bp->notaries[bp->myind].bestk = bp->bestk;
if ( bp->bestmask != 0 )

Loading…
Cancel
Save