From 9429a214473c9fa9e42ce38de5b3bcf6fd34cc41 Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 16 Dec 2016 18:48:13 +0200 Subject: [PATCH] test --- iguana/dPoW.h | 2 +- iguana/dpow/dpow_network.c | 11 ++++++++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/iguana/dPoW.h b/iguana/dPoW.h index 24296d59f..e0b35d4e9 100755 --- a/iguana/dPoW.h +++ b/iguana/dPoW.h @@ -25,7 +25,7 @@ #define DPOW_VERSION 0x0774 #define DPOW_UTXOSIZE 10000 #define DPOW_MINOUTPUT 6000 -#define DPOW_DURATION 300 +#define DPOW_DURATION 600 #define DPOW_RATIFYDURATION (3600 * 24) //#define DPOW_ENTRIESCHANNEL ('e' | ('n' << 8) | ('t' << 16) | ('r' << 24)) diff --git a/iguana/dpow/dpow_network.c b/iguana/dpow/dpow_network.c index a70166c1d..acf991049 100755 --- a/iguana/dpow/dpow_network.c +++ b/iguana/dpow/dpow_network.c @@ -412,7 +412,6 @@ void dpow_ratify_update(struct supernet_info *myinfo,struct dpow_info *dp,struct } } //printf("RECV from %d best.(%d %llx) sigs.(%d %d) %llx %llx\n",senderind,bestk,(long long)bestmask,siglens[0],siglens[1],(long long)bp->ratifysigmasks[0],(long long)bp->ratifysigmasks[1]); -// generalize for both paths bp->ratifyrecvmask = 0; bp->ratifybestmask = 0; bp->ratifybestk = -1; @@ -599,6 +598,16 @@ void dpow_bestconsensus(struct dpow_block *bp) } if ( besti >= 0 && bestks[besti] >= 0 && masks[besti] != 0 && (bp->recvmask & masks[besti]) == masks[besti] ) bp->bestmask = masks[besti], bp->bestk = bestks[besti]; + if ( bp->bestmask == 0 || (time(NULL) / 100) != bp->lastepoch ) + { + bp->bestmask = dpow_ratifybest(bp->recvmask,bp,&bp->bestk); + if ( (time(NULL) / 60) != bp->lastepoch ) + { + bp->lastepoch = (uint32_t)(time(NULL) / 100); + printf("epoch %u\n",bp->lastepoch % bp->numnotaries); + sleep(2 + (rand() % 7)); + } + } } void dpow_notarize_update(struct supernet_info *myinfo,struct dpow_info *dp,struct dpow_block *bp,uint8_t senderind,int8_t bestk,uint64_t bestmask,uint64_t recvmask,bits256 srcutxo,uint16_t srcvout,bits256 destutxo,uint16_t destvout,uint8_t siglens[2],uint8_t sigs[2][DPOW_MAXSIGLEN],uint32_t paxwdcrc)