jl777 8 years ago
parent
commit
b9cc33b474
  1. 2
      crypto777/OS_portable.h
  2. 6
      iguana/iguana_bundles.c
  3. 6
      iguana/iguana_recv.c

2
crypto777/OS_portable.h

@ -358,7 +358,7 @@ void escape_code(char *escaped,char *str);
void SaM_PrepareIndices(); void SaM_PrepareIndices();
// iguana_serdes.c // iguana_serdes.c
#define IGUANA_LOG2PACKETSIZE 21 #define IGUANA_LOG2PACKETSIZE 22
#define IGUANA_MAXPACKETSIZE (1 << IGUANA_LOG2PACKETSIZE) #define IGUANA_MAXPACKETSIZE (1 << IGUANA_LOG2PACKETSIZE)
struct iguana_msghdr { uint8_t netmagic[4]; char command[12]; uint8_t serdatalen[4],hash[4]; } PACKED; struct iguana_msghdr { uint8_t netmagic[4]; char command[12]; uint8_t serdatalen[4],hash[4]; } PACKED;

6
iguana/iguana_bundles.c

@ -615,7 +615,7 @@ struct iguana_block *iguana_bundleblock(struct iguana_info *coin,bits256 *hash2p
int32_t iguana_bundleissuemissing(struct supernet_info *myinfo,struct iguana_info *coin,struct iguana_bundle *bp,int32_t priority,double mult) int32_t iguana_bundleissuemissing(struct supernet_info *myinfo,struct iguana_info *coin,struct iguana_bundle *bp,int32_t priority,double mult)
{ {
int32_t i,max,nonz,starti,lasti,firsti,lag,num,n=0; uint32_t now; bits256 hash2; double aveduration; struct iguana_peer *addr; struct iguana_block *block; int32_t i,max,nonz,starti,lasti,firsti,lag,num,n=0; uint32_t now; bits256 hash2; double aveduration; struct iguana_peer *addr; //struct iguana_block *block;
if ( coin->peers == 0 ) if ( coin->peers == 0 )
{ {
printf("%s has no peers\n",coin->symbol); printf("%s has no peers\n",coin->symbol);
@ -690,7 +690,7 @@ int32_t iguana_bundleissuemissing(struct supernet_info *myinfo,struct iguana_inf
} }
if ( firsti >= 0 )//&& bp == coin->current ) if ( firsti >= 0 )//&& bp == coin->current )
{ {
printf("[%d] first missing.%d of %d\n",bp->hdrsi,firsti,nonz); //printf("[%d] first missing.%d of %d\n",bp->hdrsi,firsti,nonz);
iguana_bundleblock(coin,&hash2,bp,firsti); iguana_bundleblock(coin,&hash2,bp,firsti);
if ( bits256_nonz(hash2) != 0 ) if ( bits256_nonz(hash2) != 0 )
{ {
@ -699,7 +699,7 @@ int32_t iguana_bundleissuemissing(struct supernet_info *myinfo,struct iguana_inf
//if ( bp == coin->current ) //if ( bp == coin->current )
// printf("iguana_bundleissuemissing.[%d:%d]\n",bp->hdrsi,i); // printf("iguana_bundleissuemissing.[%d:%d]\n",bp->hdrsi,i);
n++; n++;
printf("send reqPT [%d:%d]\n",bp->hdrsi,firsti); //printf("send reqPT [%d:%d]\n",bp->hdrsi,firsti);
iguana_sendblockreqPT(coin,0,bp,firsti,hash2,0); iguana_sendblockreqPT(coin,0,bp,firsti,hash2,0);
} }
} else printf("no hash for [%d:%d]\n",bp->hdrsi,firsti); } else printf("no hash for [%d:%d]\n",bp->hdrsi,firsti);

6
iguana/iguana_recv.c

@ -747,7 +747,7 @@ void iguana_gotblockM(struct supernet_info *myinfo,struct iguana_info *coin,stru
bp = 0, bundlei = -2; bp = 0, bundlei = -2;
if ( iguana_bundlefind(coin,&bp,&bundlei,origtxdata->zblock.RO.prev_block) == 0 ) if ( iguana_bundlefind(coin,&bp,&bundlei,origtxdata->zblock.RO.prev_block) == 0 )
{ {
//printf("gotblockM: RTblock? %s\n",bits256_str(str,origtxdata->zblock.RO.hash2)); printf("gotblockM: RTblock? %s\n",bits256_str(str,origtxdata->zblock.RO.hash2));
numtx = origtxdata->zblock.RO.txn_count; numtx = origtxdata->zblock.RO.txn_count;
iguana_RTgotblock(coin,origtxdata->zblock.RO.hash2,data,&recvlen,&numtx); iguana_RTgotblock(coin,origtxdata->zblock.RO.hash2,data,&recvlen,&numtx);
req = iguana_recv_bundlereq(coin,addr,0,H,data,recvlen,0,-1,origtxdata); req = iguana_recv_bundlereq(coin,addr,0,H,data,recvlen,0,-1,origtxdata);
@ -774,6 +774,7 @@ void iguana_gotblockM(struct supernet_info *myinfo,struct iguana_info *coin,stru
} }
if ( bp == 0 ) if ( bp == 0 )
{ {
printf("gotblockM no bp %s\n",bits256_str(str,origtxdata->zblock.RO.hash2));
req = iguana_recv_bundlereq(coin,addr,0,H,data,recvlen,0,-1,origtxdata); req = iguana_recv_bundlereq(coin,addr,0,H,data,recvlen,0,-1,origtxdata);
queue_enqueue("recvQ",&coin->recvQ,&req->DL,0); queue_enqueue("recvQ",&coin->recvQ,&req->DL,0);
return; return;
@ -787,6 +788,7 @@ void iguana_gotblockM(struct supernet_info *myinfo,struct iguana_info *coin,stru
{ {
req = iguana_recv_bundlereq(coin,addr,0,H,data,recvlen,0,-1,origtxdata); req = iguana_recv_bundlereq(coin,addr,0,H,data,recvlen,0,-1,origtxdata);
queue_enqueue("recvQ",&coin->recvQ,&req->DL,0); queue_enqueue("recvQ",&coin->recvQ,&req->DL,0);
printf("negative speculative return %s\n",bits256_str(str,origtxdata->zblock.RO.hash2));
return; return;
} }
/*if ( block == 0 ) /*if ( block == 0 )
@ -807,7 +809,7 @@ void iguana_gotblockM(struct supernet_info *myinfo,struct iguana_info *coin,stru
} }
numtx = origtxdata->zblock.RO.txn_count; numtx = origtxdata->zblock.RO.txn_count;
iguana_RTgotblock(coin,origtxdata->zblock.RO.hash2,data,&recvlen,&numtx); iguana_RTgotblock(coin,origtxdata->zblock.RO.hash2,data,&recvlen,&numtx);
//printf("getblockM update [%d:%d] %s\n",bp->hdrsi,bundlei,bits256_str(str,origtxdata->zblock.RO.hash2)); printf("getblockM update [%d:%d] %s %p\n",bp->hdrsi,bundlei,bits256_str(str,origtxdata->zblock.RO.hash2),block);
if ( block != 0 ) if ( block != 0 )
{ {
if ( block->height < 0 ) if ( block->height < 0 )

Loading…
Cancel
Save