Browse Source

debug

blackjok3r
blackjok3r 6 years ago
parent
commit
3860b0fcee
  1. 2
      iguana/dpow/dpow_fsm.c
  2. 2
      iguana/dpow/dpow_network.c
  3. 4
      iguana/dpow/dpow_tx.c

2
iguana/dpow/dpow_fsm.c

@ -300,7 +300,7 @@ void dpow_statemachinestart(void *ptr)
bp = calloc(1,sizeof(*bp));
blockindex = dpow_blockfind(myinfo,dp);
dp->blocks[blockindex] = bp;
//printf("allocate bp for %s ht.%d -> %s\n",src->symbol,checkpoint.blockhash.height,dest->symbol);
printf("blockindex.%i allocate bp for %s ht.%d -> %s\n",src->symbol,checkpoint.blockhash.height,dest->symbol);
//Numallocated++;
bp->MoM = MoM;
bp->MoMdepth = MoMdepth;

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 )

4
iguana/dpow/dpow_tx.c

@ -176,9 +176,13 @@ struct dpow_block *dpow_heightfind(struct supernet_info *myinfo,struct dpow_info
int32_t i; struct dpow_block *bp = 0;
for (i = 0; i < dp->maxblocks; i++)
{
if ( dp->blocks[i] != 0 )
{
fprintf(stderr, "symbol.%s height.%i dp_height.%i\n",dp->symbol, height, dp->blocks[i]->height);
if ( height == dp->blocks[i]->height )
return(bp);
}
}
return(0);
}

Loading…
Cancel
Save