From 3c772818477c30a603e0e8e6d821a9f12bf9362d Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 4 Nov 2016 14:27:21 -0300 Subject: [PATCH] test --- iguana/dpow/dpow_fsm.c | 8 +++++--- iguana/dpow/dpow_network.c | 2 +- iguana/dpow/dpow_tx.c | 4 ++-- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/iguana/dpow/dpow_fsm.c b/iguana/dpow/dpow_fsm.c index 5172db327..36bd853f8 100755 --- a/iguana/dpow/dpow_fsm.c +++ b/iguana/dpow/dpow_fsm.c @@ -211,13 +211,13 @@ int32_t dpow_datahandler(struct supernet_info *myinfo,struct dpow_info *dp,uint3 src_or_dest = 1; coin = bp->destcoin; cp = &bp->notaries[dsig.senderind].dest; + printf("gotsig %s channel.%x from %d bestk.%d %llx\n",coin->symbol,channel,dsig.senderind,dsig.lastk,(long long)dsig.mask); } else { src_or_dest = 0; coin = bp->srccoin; cp = &bp->notaries[dsig.senderind].src; - printf("got %s channel.%x from %d\n",coin->symbol,channel,dsig.senderind); } if ( dsig.senderind >= 0 && dsig.senderind < DPOW_MAXRELAYS ) { @@ -362,6 +362,8 @@ int32_t dpow_update(struct supernet_info *myinfo,struct dpow_info *dp,struct dpo if ( bp->bestk >= 0 ) dpow_signedtxgen(myinfo,dp,(bp->state < 1000) ? bp->destcoin : bp->srccoin,bp,bp->bestk,bp->bestmask,myind,bp->state < 1000 ? DPOW_SIGBTCCHANNEL : DPOW_SIGCHANNEL,bp->state < 1000); printf("ht.%d numnotaries.%d BEST.%llx from RECV.%llx bestk.%d\n",bp->height,bp->numnotaries,(long long)bp->bestmask,(long long)bp->recvmask,bp->bestk); + if ( bp->height < DPOW_FIRSTRATIFY ) + dp->blocks[bp->height] = bp; } } if ( bp->state < 1000 && bp->bestk >= 0 && (bp->destsigsmasks[bp->bestk] & bp->bestmask) == bp->bestmask ) @@ -513,12 +515,12 @@ void dpow_statemachinestart(void *ptr) dp->blocks[checkpoint.blockhash.height] = bp; bp->beacon = rand256(0); vcalc_sha256(0,bp->commit.bytes,bp->beacon.bytes,sizeof(bp->beacon)); - if ( checkpoint.blockhash.height >= DPOW_FIRSTRATIFY && dp->blocks[checkpoint.blockhash.height - DPOW_FIRSTRATIFY] != 0 ) + /*if ( checkpoint.blockhash.height >= DPOW_FIRSTRATIFY && dp->blocks[checkpoint.blockhash.height - DPOW_FIRSTRATIFY] != 0 ) { printf("purge %s.%d\n",dp->dest,checkpoint.blockhash.height - DPOW_FIRSTRATIFY); free(dp->blocks[checkpoint.blockhash.height - DPOW_FIRSTRATIFY]); dp->blocks[checkpoint.blockhash.height - DPOW_FIRSTRATIFY] = 0; - } + }*/ } bitcoin_address(srcaddr,src->chain->pubtype,dp->minerkey33,33); bitcoin_address(destaddr,dest->chain->pubtype,dp->minerkey33,33); diff --git a/iguana/dpow/dpow_network.c b/iguana/dpow/dpow_network.c index f8f2586a2..de3ae3a8a 100755 --- a/iguana/dpow/dpow_network.c +++ b/iguana/dpow/dpow_network.c @@ -352,7 +352,7 @@ void dpow_sigsend(struct supernet_info *myinfo,struct dpow_info *dp,struct dpow_ { struct dpow_sigentry dsig; int32_t i,len; uint8_t data[4096]; struct dpow_entry *ep; ep = &bp->notaries[myind]; - //printf("ht.%d sigsend.%s: myind.%d bestk.%d %llx >>>>>> broadcast channel.%x\n",bp->height,sigchannel == DPOW_SIGCHANNEL ? bp->srccoin->symbol : bp->destcoin->symbol,myind,bestk,(long long)bestmask,sigchannel); + printf("ht.%d sigsend.%s: myind.%d bestk.%d %llx >>>>>> broadcast channel.%x\n",bp->height,sigchannel == DPOW_SIGCHANNEL ? bp->srccoin->symbol : bp->destcoin->symbol,myind,bestk,(long long)bestmask,sigchannel); memset(&dsig,0,sizeof(dsig)); for (i=0; i<33; i++) dsig.senderpub[i] = dp->minerkey33[i]; diff --git a/iguana/dpow/dpow_tx.c b/iguana/dpow/dpow_tx.c index 5b96fe8ec..4a5cd700f 100755 --- a/iguana/dpow/dpow_tx.c +++ b/iguana/dpow/dpow_tx.c @@ -163,7 +163,7 @@ bits256 dpow_notarytx(char *signedtx,int32_t *numsigsp,int32_t isPoS,struct dpow len += iguana_rwvarint32(1,&serialized[len],(uint32_t *)&m); for (j=m=0; jnumnotaries; j++) { - k = DPOW_MODIND(bp,j);//((bp->height % bp->numnotaries) + j) % bp->numnotaries; + k = DPOW_MODIND(bp,j); if ( ((1LL << k) & bestmask) != 0 ) { ep = &bp->notaries[k]; @@ -214,7 +214,7 @@ cJSON *dpow_vins(struct iguana_info *coin,struct dpow_block *bp,int8_t bestk,uin vins = cJSON_CreateArray(); for (j=0; jnumnotaries; j++) { - k = DPOW_MODIND(bp,j);//((bp->height % bp->numnotaries) + j) % bp->numnotaries; + k = DPOW_MODIND(bp,j); if ( ((1LL << k) & bestmask) != 0 ) { ep = &bp->notaries[k];