Browse Source

test

release/v0.1
jl777 8 years ago
parent
commit
720fa485c6
  1. 2
      basilisk/basilisk_MSG.c
  2. 4
      iguana/iguana_recv.c

2
basilisk/basilisk_MSG.c

@ -121,14 +121,12 @@ char *basilisk_iterate_MSG(struct supernet_info *myinfo,uint32_t channel,uint32_
}
if ( bits256_nonz(srchash) != 0 || bits256_nonz(desthash) != 0 )
{
printf("check broadcast %u %u\n",channel,msgid);
keylen = basilisk_messagekey(key,channel,msgid,zero,zero);
if ( (item= basilisk_respond_getmessage(myinfo,key,keylen)) != 0 )
jaddi(array,item);
}
}
msgid--;
iguana_rwnum(1,&key[0],sizeof(uint32_t),&msgid);
}
if ( cJSON_GetArraySize(array) > 0 )
{

4
iguana/iguana_recv.c

@ -72,7 +72,7 @@ int32_t iguana_sendblockreqPT(struct iguana_info *coin,struct iguana_peer *addr,
if ( memcmp(lastreq.bytes,hash2.bytes,sizeof(hash2)) == 0 || memcmp(lastreq2.bytes,hash2.bytes,sizeof(hash2)) == 0 )
{
//printf("duplicate req %s or null addr.%p\n",bits256_str(hexstr,hash2),addr);
if ( iamthreadsafe == 0 && (rand() % 10 ) != 0 )
if ( iamthreadsafe == 0 && (rand() % 3) != 0 )
return(0);
}
if ( addr->usock < 0 )
@ -84,7 +84,7 @@ int32_t iguana_sendblockreqPT(struct iguana_info *coin,struct iguana_peer *addr,
{
//char str[65];
recvlen = numtx = 0;
if ( iguana_RTrawdata(coin,hash2,0,&recvlen,&numtx,1) != 0 )
if ( coin->RTheight > 0 && iguana_RTrawdata(coin,hash2,0,&recvlen,&numtx,1) != 0 )
{
//printf("found valid [%d:%d] in blockreqPT\n",checkbp->hdrsi,j);
return(0);

Loading…
Cancel
Save