jl777 8 years ago
parent
commit
ececb271db
  1. 4
      iguana/dpow/dpow_fsm.c
  2. 8
      iguana/dpow/dpow_tx.c

4
iguana/dpow/dpow_fsm.c

@ -200,7 +200,7 @@ int32_t dpow_datahandler(struct supernet_info *myinfo,struct dpow_info *dp,uint8
dpow_utxosync(myinfo,dp,bp,0,myind,srchash);
bp->recvmask |= (1LL << senderind);
}
dpow_sync(myinfo,1,dp,bp,-1,ep->recvmask,myind,srchash,channel,src_or_dest);
dpow_sync(myinfo,0,dp,bp,-1,ep->recvmask,myind,srchash,channel,src_or_dest);
flag = 1;
}
//printf("bestk.%d %llx vs recv.%llx\n",bp->bestk,(long long)bp->bestmask,(long long)bp->recvmask);
@ -623,7 +623,7 @@ void dpow_statemachinestart(void *ptr)
//printf("done utxosync start.%u %u\n",starttime,(uint32_t)time(NULL));
while ( time(NULL) < starttime+bp->duration && src != 0 && dest != 0 && bp->state != 0xffffffff )
{
sleep(1);
sleep(3);
if ( dp->checkpoint.blockhash.height > checkpoint.blockhash.height )
{
if ( bp->isratify == 0 )

8
iguana/dpow/dpow_tx.c

@ -13,6 +13,8 @@
* *
******************************************************************************/
#define DPOW_BLACKLIST -100000
void dpow_bestmask_update(struct supernet_info *myinfo,struct dpow_info *dp,struct dpow_block *bp,uint8_t nn_senderind,int8_t nn_bestk,uint64_t nn_bestmask)
{
int32_t startscore;
@ -32,7 +34,7 @@ void dpow_bestmask_update(struct supernet_info *myinfo,struct dpow_info *dp,stru
else if ( bp->scores[nn_senderind] < 1 )
bp->scores[nn_senderind] = 1;
else bp->scores[nn_senderind]++;
if ( startscore > -1000000 && bp->scores[nn_senderind] <= -1000000 )
if ( startscore > DPOW_BLACKLIST && bp->scores[nn_senderind] <= DPOW_BLACKLIST )
printf(">>>>>>>>>>>>> nn_senderind.%d %llx MIA, skip this node for now\n",nn_senderind,(long long)(1LL << nn_senderind));
}
}
@ -45,7 +47,7 @@ uint64_t dpow_lastk_mask(struct dpow_block *bp,int8_t *lastkp)
for (j=0; j<bp->numnotaries; j++)
{
k = DPOW_MODIND(bp,j);
if ( (bp->require0 == 0 || k != 0) && bp->scores[k] < -1000000 )
if ( (bp->require0 == 0 || k != 0) && bp->scores[k] < DPOW_BLACKLIST )
continue;
if ( bits256_nonz(bp->notaries[k].src.prev_hash) != 0 && bits256_nonz(bp->notaries[k].dest.prev_hash) != 0 )
{
@ -80,7 +82,7 @@ uint64_t dpow_maskmin(uint64_t refmask,struct dpow_block *bp,int8_t *lastkp)
for (j=0; j<bp->numnotaries; j++)
{
k = DPOW_MODIND(bp,j);
if ( (bp->require0 == 0 || k != 0) && bp->scores[k] < -1000000 )
if ( (bp->require0 == 0 || k != 0) && bp->scores[k] < DPOW_BLACKLIST )
continue;
if ( bits256_nonz(bp->notaries[k].src.prev_hash) != 0 && bits256_nonz(bp->notaries[k].dest.prev_hash) != 0 )
{

Loading…
Cancel
Save