Browse Source

Merge pull request #18 from KMDLabs/staked

fix
blackjok3r
blackjok3rtt 6 years ago
committed by GitHub
parent
commit
1a2a9c3197
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      iguana/dpow/dpow_fsm.c
  2. 2
      iguana/dpow/dpow_network.c
  3. 6
      iguana/dpow/dpow_tx.c

4
iguana/dpow/dpow_fsm.c

@ -297,11 +297,11 @@ void dpow_statemachinestart(void *ptr)
}
if ( (bp= dpow_heightfind(myinfo,dp, checkpoint.blockhash.height)) == 0 )
{
if ( (blockindex= dpow_blockfind(myinfo,dp)) < 0 )
return;
bp = calloc(1,sizeof(*bp));
blockindex = dpow_blockfind(myinfo,dp);
dp->blocks[blockindex] = bp;
printf("blockindex.%i allocate bp for %s ht.%d -> %s\n",blockindex,src->symbol,checkpoint.blockhash.height,dest->symbol);
//Numallocated++;
bp->MoM = MoM;
bp->MoMdepth = MoMdepth;
bp->CCid = dp->fullCCid & 0xffff;

2
iguana/dpow/dpow_network.c

@ -2315,7 +2315,7 @@ int32_t dpow_nanomsg_update(struct supernet_info *myinfo)
dpow_ipbitsadd(myinfo,dp,np->ipbits,np->numipbits,sizeof(np->ipbits)/sizeof(*np->ipbits),np->senderind,np->myipbits);
if ( (bp= dpow_heightfind(myinfo,dp,np->height)) != 0 && bp->state != 0xffffffff && bp->myind >= 0 )
{
char str[65]; printf("%s RECV ht.%d ch.%08x (%d) crc32.%08x:%08x datalen.%d:%d firstz.%d i.%d senderind.%d myind.%d\n",bits256_str(str,np->srchash),np->height,np->channel,size,np->crc32,crc32,np->datalen,(int32_t)(size - sizeof(*np)),firstz,i,np->senderind,bp->myind);
//char str[65]; printf("%s RECV ht.%d ch.%08x (%d) crc32.%08x:%08x datalen.%d:%d firstz.%d i.%d senderind.%d myind.%d\n",bits256_str(str,np->srchash),np->height,np->channel,size,np->crc32,crc32,np->datalen,(int32_t)(size - sizeof(*np)),firstz,i,np->senderind,bp->myind);
if ( np->senderind >= 0 && np->senderind < bp->numnotaries )
{
if ( memcmp(bp->notaries[np->senderind].pubkey+1,np->srchash.bytes,32) == 0 && bits256_nonz(np->srchash) != 0 )

6
iguana/dpow/dpow_tx.c

@ -177,7 +177,7 @@ struct dpow_block *dpow_heightfind(struct supernet_info *myinfo,struct dpow_info
for (i = 0; i < dp->maxblocks; i++)
{
if ( dp->blocks[i] != 0 && height == dp->blocks[i]->height )
return(bp);
return(dp->blocks[i]);
}
return(bp);
}
@ -190,7 +190,7 @@ int32_t dpow_blockfind(struct supernet_info *myinfo,struct dpow_info *dp)
if ( dp->blocks[i] == 0 )
return(i);
}
return(0);
return(-1);
}
/* maybe this is better not sure...
@ -204,7 +204,7 @@ int32_t dpow_blockfind(struct supernet_info *myinfo,struct dpow_info *dp)
if ( dp->blocks[i] == 0 )
break;
}
return(0);
return(-1);
}*/
int32_t dpow_voutstandard(struct supernet_info *myinfo,struct dpow_block *bp,uint8_t *serialized,int32_t m,int32_t src_or_dest,uint8_t pubkeys[][33],int32_t numratified)

Loading…
Cancel
Save