From bd72942edb302741695059e42322170c9b3cdd67 Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 14 Oct 2016 11:44:54 -0300 Subject: [PATCH] test --- iguana/iguana_notary.c | 26 ++++++++++++++++++++------ iguana/main.c | 1 + 2 files changed, 21 insertions(+), 6 deletions(-) diff --git a/iguana/iguana_notary.c b/iguana/iguana_notary.c index 81af968ed..c1ef9dd0e 100755 --- a/iguana/iguana_notary.c +++ b/iguana/iguana_notary.c @@ -86,21 +86,35 @@ uint32_t dpow_send(struct supernet_info *myinfo,struct dpow_block *bp,bits256 sr free(np); printf("NANOSEND ht.%d channel.%08x (%d) crc32.%08x\n",np->height,np->channel,size,np->crc32); return(sentbytes); - //return(basilisk_channelsend(myinfo,srchash,desthash,channel,msgbits,data,datalen,120)); - //return(basilisk_crcsend(myinfo,1,bp->sendbuf,sizeof(bp->sendbuf),srchash,desthash,channel,msgbits,data,datalen,crcs)); } void dpow_nanomsg_update(struct supernet_info *myinfo) { - int32_t size; uint32_t crc32; struct dpow_nanomsghdr *np; + static uint32_t crcs[1024]; + int32_t i,size,firstz = -1; uint32_t crc32; struct dpow_nanomsghdr *np; while ( (size= nn_recv(myinfo->DPOW.sock,&np,NN_MSG,0)) >= 0 ) { if ( size >= 0 ) { crc32 = calc_crc32(0,np->packet,np->datalen); - 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))); if ( crc32 == np->crc32 && np->datalen == (size - sizeof(*np)) ) + { + for (i=0; iheight,np->channel,size,np->crc32,crc32,np->datalen,(int32_t)(size - sizeof(*np))); dpow_datahandler(myinfo,0,np->channel,np->height,np->packet,size - np->size); + } if ( np != 0 ) nn_freemsg(np); } @@ -1084,7 +1098,7 @@ int32_t dpow_update(struct supernet_info *myinfo,struct dpow_block *bp,uint32_t { if ( ep->masks[bp->bestk] == 0 ) dpow_signedtxgen(myinfo,bp->coin,bp,bp->bestk,bp->bestmask,myind,bp->opret_symbol,sigchannel); - //else dpow_sigsend(myinfo,bp,myind,bp->bestk,bp->bestmask,srchash,sigchannel); + else dpow_sigsend(myinfo,bp,myind,bp->bestk,bp->bestmask,srchash,sigchannel); } //dpow_channelget(myinfo,bp,txidchannel); @@ -1093,7 +1107,7 @@ int32_t dpow_update(struct supernet_info *myinfo,struct dpow_block *bp,uint32_t //dpow_channelget(myinfo,bp,sigchannel); if ( ep->masks[bp->bestk] == 0 ) dpow_signedtxgen(myinfo,bp->coin,bp,bp->bestk,bp->bestmask,myind,bp->opret_symbol,sigchannel); - //else dpow_sigsend(myinfo,bp,myind,bp->bestk,bp->bestmask,srchash,sigchannel); + else dpow_sigsend(myinfo,bp,myind,bp->bestk,bp->bestmask,srchash,sigchannel); } return(bp->state); } diff --git a/iguana/main.c b/iguana/main.c index 1cec8786e..1a420c07d 100755 --- a/iguana/main.c +++ b/iguana/main.c @@ -1359,6 +1359,7 @@ STRING_ARG(SuperNET,myipaddr,ipaddr) { strcpy(myinfo->ipaddr,ipaddr); myinfo->myaddr.myipbits = (uint32_t)calc_ipbits(ipaddr); + printf("SET MYIPADDR.(%s)\n",ipaddr); basilisk_setmyid(myinfo); } }