Browse Source

test

etomic
jl777 8 years ago
parent
commit
9429a21447
  1. 2
      iguana/dPoW.h
  2. 11
      iguana/dpow/dpow_network.c

2
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))

11
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)

Loading…
Cancel
Save