jl777 8 years ago
parent
commit
1fa67da5b5
  1. 2
      iguana/dPoW.h
  2. 7
      iguana/dpow/dpow_fsm.c
  3. 4
      iguana/dpow/dpow_network.c

2
iguana/dPoW.h

@ -16,7 +16,7 @@
#ifndef INCLUDE_DPOW_H
#define INCLUDE_DPOW_H
#define DPOW_M(bp) (2) // (((bp)->numnotaries >> 1) + 1)
#define DPOW_M(bp) (3) // (((bp)->numnotaries >> 1) + 1)
#define DPOW_VERSION 0x0103
#define DPOW_UTXOSIZE 10000

7
iguana/dpow/dpow_fsm.c

@ -87,10 +87,9 @@ void dpow_datahandler(struct supernet_info *myinfo,uint32_t channel,uint32_t hei
ep->recvmask = E.recvmask;
dpow_sync(myinfo,bp,ep->recvmask,myind,srchash,channel);
flag = 1;
printf("<<<<<<<<<< %s from.%ld got ht.%d %s/v%d\n",bp->coin->symbol,((long)ep - (long)bp->notaries)/sizeof(*ep),height,bits256_str(str,E.prev_hash),E.prev_vout);
}
}
//if ( 0 && flag == 0 && bp != 0 )
if ( 0 && flag == 0 && bp != 0 )
printf("UTXO.%d hashmsg.(%s) txid.(%s) v%d\n",height,bits256_str(str,hashmsg),bits256_str(str2,E.prev_hash),E.prev_vout);
}
else if ( channel == DPOW_SIGCHANNEL || channel == DPOW_SIGBTCCHANNEL )
@ -120,12 +119,12 @@ void dpow_datahandler(struct supernet_info *myinfo,uint32_t channel,uint32_t hei
} else printf("%s pubkey mismatch for senderind.%d %llx vs %llx\n",bp->coin->symbol,dsig.senderind,*(long long *)dsig.senderpub,*(long long *)bp->notaries[dsig.senderind].pubkey);
} else printf("%s illegal lastk.%d or senderind.%d or senderpub.%llx\n",bp->coin->symbol,dsig.lastk,dsig.senderind,*(long long *)dsig.senderpub);
} else printf("couldnt find senderind.%d height.%d channel.%x\n",dsig.senderind,height,channel);
//if ( 0 && bp != 0 )
if ( 0 && bp != 0 )
printf(" SIG.%d sender.%d lastk.%d mask.%llx siglen.%d recv.%llx\n",height,dsig.senderind,dsig.lastk,(long long)dsig.mask,dsig.siglen,(long long)bp->recvmask);
}
else if ( channel == DPOW_TXIDCHANNEL || channel == DPOW_BTCTXIDCHANNEL )
{
printf("handle channel.%x\n",channel);
printf("handle txid channel.%x\n",channel);
if ( (bp= dpow_heightfind(myinfo,height,channel == DPOW_BTCTXIDCHANNEL)) != 0 )
{
//printf("bp.%p datalen.%d\n",bp,datalen);

4
iguana/dpow/dpow_network.c

@ -97,7 +97,7 @@ void dpow_send(struct supernet_info *myinfo,struct dpow_block *bp,bits256 srchas
memcpy(np->packet,data,datalen);
sentbytes = nn_send(myinfo->DPOW.sock,np,size,0);
free(np);
printf("NANOSEND ht.%d channel.%08x (%d) crc32.%08x datalen.%d\n",np->height,np->channel,size,np->crc32,datalen);
//printf("NANOSEND ht.%d channel.%08x (%d) crc32.%08x datalen.%d\n",np->height,np->channel,size,np->crc32,datalen);
}
}
@ -114,7 +114,7 @@ void dpow_nanomsg_update(struct supernet_info *myinfo)
if ( crc32 == np->crc32 && (firstz= dpow_crc32find(myinfo,crc32,np->channel)) >= 0 )
{
myinfo->DPOW.crcs[firstz] = crc32;
printf("NANORECV ht.%d channel.%08x (%d) crc32.%08x:%08x datalen.%d:%d\n",np->height,np->channel,size,np->crc32,crc32,np->datalen,(int32_t)(size - sizeof(*np)));
//printf("NANORECV ht.%d channel.%08x (%d) crc32.%08x:%08x datalen.%d:%d\n",np->height,np->channel,size,np->crc32,crc32,np->datalen,(int32_t)(size - sizeof(*np)));
dpow_datahandler(myinfo,np->channel,np->height,np->packet,np->datalen);
}
} else printf("np->datalen.%d (size %d - %ld)\n",np->datalen,size,sizeof(*np));

Loading…
Cancel
Save