jl777 8 years ago
parent
commit
bb6b64802b
  1. 5
      iguana/dpow/dpow_fsm.c
  2. 3
      iguana/dpow/dpow_network.c
  3. 1
      iguana/tests/addnotarys_7776

5
iguana/dpow/dpow_fsm.c

@ -61,7 +61,7 @@ void dpow_sync(struct supernet_info *myinfo,struct dpow_block *bp,uint64_t refma
void dpow_datahandler(struct supernet_info *myinfo,uint32_t channel,uint32_t height,uint8_t *data,int32_t datalen)
{
bits256 hashmsg,txid,commit,srchash; struct dpow_block *bp = 0; uint32_t flag = 0; int32_t senderind,i,vout,myind = -1; char str[65],str2[65]; struct dpow_sigentry dsig; struct dpow_entry *ep,E;
bits256 hashmsg,txid,commit,srchash; struct dpow_block *bp = 0; uint32_t flag = 0; int32_t senderind,i,myind = -1; char str[65],str2[65]; struct dpow_sigentry dsig; struct dpow_entry *ep,E;
if ( channel == DPOW_UTXOCHANNEL || channel == DPOW_UTXOBTCCHANNEL )
{
memset(&E,0,sizeof(E));
@ -125,8 +125,10 @@ void dpow_datahandler(struct supernet_info *myinfo,uint32_t channel,uint32_t hei
}
else if ( channel == DPOW_TXIDCHANNEL || channel == DPOW_BTCTXIDCHANNEL )
{
printf("handle channel.%x\n",channel);
if ( (bp= dpow_heightfind(myinfo,height,channel == DPOW_BTCTXIDCHANNEL)) != 0 )
{
printf("bp.%p datalen.%d\n",bp,datalen);
for (i=0; i<32; i++)
srchash.bytes[i] = data[i];
/*if ( srchash.ulongs[0] == 0 )
@ -139,6 +141,7 @@ void dpow_datahandler(struct supernet_info *myinfo,uint32_t channel,uint32_t hei
{
txid = bits256_doublesha256(0,&data[32],datalen-32);
init_hexbytes_noT(bp->signedtx,&data[32],datalen-32);
printf("signedtx.(%s)\n",bp->signedtx);
if ( bits256_cmp(txid,srchash) == 0 )
{
printf("verify (%s) it is properly signed! set ht.%d signedtxid to %s\n",bp->coin->symbol,height,bits256_str(str,txid));

3
iguana/dpow/dpow_network.c

@ -110,7 +110,8 @@ void dpow_nanomsg_update(struct supernet_info *myinfo)
{
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)));
dpow_datahandler(myinfo,np->channel,np->height,np->packet,size - np->size);
dpow_datahandler(myinfo,np->channel,np->height,np->packet,np->datalen);
printf("returned from datahandler\n");
}
} else printf("np->datalen.%d (size %d - %ld)\n",np->datalen,size,sizeof(*np));
if ( np != 0 )

1
iguana/tests/addnotarys_7776

@ -12,6 +12,7 @@ curl --url "http://127.0.0.1:7776" --data "{\"agent\":\"iguana\",\"method\":\"ad
curl --url "http://127.0.0.1:7776" --data "{\"agent\":\"iguana\",\"method\":\"addnotary\",\"ipaddr\":\"94.102.63.199\"}"
curl --url "http://127.0.0.1:7776" --data "{\"agent\":\"iguana\",\"method\":\"addnotary\",\"ipaddr\":\"27.100.36.201\"}"
curl --url "http://127.0.0.1:7776" --data "{\"agent\":\"iguana\",\"method\":\"addnotary\",\"ipaddr\":\"94.102.63.218\"}"
curl --url "http://127.0.0.1:7776" --data "{\"agent\":\"iguana\",\"method\":\"addnotary\",\"ipaddr\":\"149.56.28.84\"}"
curl --url "http://127.0.0.1:7776" --data "{\"agent\":\"iguana\",\"method\":\"addnotary\",\"ipaddr\":\"94.102.63.227\"}"
curl --url "http://127.0.0.1:7776" --data "{\"agent\":\"iguana\",\"method\":\"addnotary\",\"ipaddr\":\"120.136.2.29\"}"
curl --url "http://127.0.0.1:7776" --data "{\"agent\":\"iguana\",\"method\":\"addnotary\",\"ipaddr\":\"149.202.65.200\"}"

Loading…
Cancel
Save