Browse Source

test

release/v0.1
jl777 9 years ago
parent
commit
adba8cac7e
  1. 7
      gecko/gecko_blocks.c
  2. 2
      gecko/gecko_headers.c
  3. 5
      gecko/gecko_miner.c

7
gecko/gecko_blocks.c

@ -341,10 +341,15 @@ int32_t basilisk_blocksubmit(struct supernet_info *myinfo,struct iguana_info *bt
free_json(retjson); free_json(retjson);
} }
free(str); free(str);
if ( (numresults >= myinfo->numrelays >> 1) && (str= gecko_blockarrived(myinfo,virt,"127.0.0.1",data,datalen,hash2,0)) != 0 ) #ifndef __APPLE__
if ( numresults >= (myinfo->numrelays >> 1) )
#endif
{
if ( (str= gecko_blockarrived(myinfo,virt,"127.0.0.1",data,datalen,hash2,0)) != 0 )
free(str); free(str);
} }
} }
}
if ( allocptr != 0 ) if ( allocptr != 0 )
free(allocptr); free(allocptr);
return(numresults); return(numresults);

2
gecko/gecko_headers.c

@ -96,7 +96,7 @@ void gecko_requesthdrs(struct supernet_info *myinfo,struct iguana_info *virt,int
memset(zero.bytes,0,sizeof(zero)); memset(zero.bytes,0,sizeof(zero));
jaddstr(vals,"symbol",virt->symbol); jaddstr(vals,"symbol",virt->symbol);
jaddstr(vals,"type","HDR"); jaddstr(vals,"type","HDR");
if ( (retstr= basilisk_standardservice("GET",myinfo,bp->hashes[0],vals,0,1)) != 0 ) if ( (retstr= basilisk_standardservice("GET",myinfo,bp->hashes[0],vals,0,0)) != 0 )
free(retstr); free(retstr);
free_json(vals); free_json(vals);
} else printf("dont have bundle needed\n"); } else printf("dont have bundle needed\n");

5
gecko/gecko_miner.c

@ -330,7 +330,9 @@ int32_t gecko_blocksubmit(struct supernet_info *myinfo,struct iguana_info *btcd,
void gecko_miner(struct supernet_info *myinfo,struct iguana_info *btcd,struct iguana_info *virt,int32_t maxmillis,uint8_t *minerpubkey33) void gecko_miner(struct supernet_info *myinfo,struct iguana_info *btcd,struct iguana_info *virt,int32_t maxmillis,uint8_t *minerpubkey33)
{ {
struct iguana_zblock newblock; uint32_t prevtimestamp,nBits; int64_t reward = 0; int32_t i,gap,txn_count; char *blockstr,*space[256]; struct gecko_memtx **txptrs; void *ptr; //struct iguana_bundle *bp; struct iguana_zblock newblock; uint32_t prevtimestamp,nBits; int64_t reward = 0; int32_t txn_count; char *blockstr,*space[256]; struct gecko_memtx **txptrs; void *ptr; //struct iguana_bundle *bp;
#ifndef __APPLE__
int32_t i,gap;
if ( virt->virtualchain == 0 || myinfo->RELAYID < 0 || myinfo->numrelays < 1 ) if ( virt->virtualchain == 0 || myinfo->RELAYID < 0 || myinfo->numrelays < 1 )
{ {
//printf("skip non-virtual chain.%s\n",virt->symbol); //printf("skip non-virtual chain.%s\n",virt->symbol);
@ -349,6 +351,7 @@ void gecko_miner(struct supernet_info *myinfo,struct iguana_info *btcd,struct ig
if ( i == gap ) if ( i == gap )
return; return;
} }
#endif
if ( virt->newblockstr != 0 ) if ( virt->newblockstr != 0 )
{ {
gecko_blocksubmit(myinfo,btcd,virt,virt->newblockstr,virt->newblock.RO.hash2,virt->newblock.height); gecko_blocksubmit(myinfo,btcd,virt,virt->newblockstr,virt->newblock.RO.hash2,virt->newblock.height);

Loading…
Cancel
Save