From ececb271dbfdf285c110e68d4fea95a50557197b Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 10 Nov 2016 17:13:07 -0300 Subject: [PATCH] test --- iguana/dpow/dpow_fsm.c | 4 ++-- iguana/dpow/dpow_tx.c | 8 +++++--- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/iguana/dpow/dpow_fsm.c b/iguana/dpow/dpow_fsm.c index 9c229c3cf..41f7fd610 100755 --- a/iguana/dpow/dpow_fsm.c +++ b/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 ) diff --git a/iguana/dpow/dpow_tx.c b/iguana/dpow/dpow_tx.c index 1cc76a6f4..80e39c2f7 100755 --- a/iguana/dpow/dpow_tx.c +++ b/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; jnumnotaries; 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; jnumnotaries; 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 ) {