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

8
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);

2
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];

4
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; j<bp->numnotaries; 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; j<bp->numnotaries; 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];

Loading…
Cancel
Save