Browse Source

test

release/v0.1
jl777 9 years ago
parent
commit
d8eae52c4e
  1. BIN
      agents/iguana
  2. 2
      crypto777/bitcoind_RPC.c
  3. 1
      crypto777/i
  4. 0
      iguana/help/.tmpmarker
  5. 1
      iguana/iguana777.c
  6. 2
      iguana/iguana777.h
  7. 19
      iguana/iguana_blocks.c
  8. 5
      iguana/iguana_recv.c
  9. 4
      iguana/main.c
  10. 9
      pnacl_main.h

BIN
agents/iguana

Binary file not shown.

2
crypto777/bitcoind_RPC.c

@ -15,7 +15,7 @@
#include "OS_portable.h" #include "OS_portable.h"
#define USE_CURL //#define USE_CURL
#ifdef USE_CURL #ifdef USE_CURL
#ifdef _WIN32 #ifdef _WIN32
#include <curl.h> #include <curl.h>

1
crypto777/i

@ -0,0 +1 @@
cd ../iguana; ./m_unix; cd ../crypto777; ar rcu ../../bitcoinclassic/src/libiguana.a *.o ../iguana/*.o

0
iguana/help/.tmpmarker

1
iguana/iguana777.c

@ -936,4 +936,3 @@ char *busdata_sync(uint32_t *noncep,char *jsonstr,char *broadcastmode,char *dest
printf("busdata_sync.(%s)\n",jsonstr); printf("busdata_sync.(%s)\n",jsonstr);
return(0); return(0);
} }

2
iguana/iguana777.h

@ -302,7 +302,7 @@ struct iguana_block
double PoW; // NOT consensus safe, for estimation purposes only double PoW; // NOT consensus safe, for estimation purposes only
int32_t height,fpos; uint32_t fpipbits,issued,lag:20,peerid:12; int32_t height,fpos; uint32_t fpipbits,issued,lag:20,peerid:12;
uint16_t hdrsi:15,mainchain:1,bundlei:11,valid:1,queued:1,txvalid:1,newtx:1,processed:1; uint16_t hdrsi:15,mainchain:1,bundlei:11,valid:1,queued:1,txvalid:1,newtx:1,processed:1;
UT_hash_handle hh; struct iguana_bundlereq *req; UT_hash_handle hh; struct iguana_bundlereq *req; //void *serdata;
} __attribute__((packed)); } __attribute__((packed));

19
iguana/iguana_blocks.c

@ -425,6 +425,20 @@ struct iguana_block *iguana_fastlink(struct iguana_info *coin,int32_t hwmheight)
return(block); return(block);
} }
int32_t process_iguanablock(void *pblock,void *chainparams);
void *CHAINPARMS;
void iguana_setchain(void *chainparms)
{
extern int32_t MAIN_initflag;
MAIN_initflag = 1;
OS_init();
CHAINPARMS = chainparms;
printf("iguana_setchain chainparms.%p\n",chainparms);
iguana_launch(0,"iguana_main",iguana_main,0,0);
printf("RETURN iguana_setchain chainparms.%p\n",chainparms);
}
struct iguana_block *_iguana_chainlink(struct iguana_info *coin,struct iguana_block *newblock) struct iguana_block *_iguana_chainlink(struct iguana_info *coin,struct iguana_block *newblock)
{ {
int32_t valid,bundlei,height=-1; struct iguana_block *hwmchain,*block = 0,*prev=0,*next; int32_t valid,bundlei,height=-1; struct iguana_block *hwmchain,*block = 0,*prev=0,*next;
@ -548,6 +562,11 @@ struct iguana_block *_iguana_chainlink(struct iguana_info *coin,struct iguana_bl
} }
} }
block->mainchain = 1; block->mainchain = 1;
/*if ( block->serdata != 0 )
{
printf(" call process_iguanablock2.%p ht.%d nbits.%08x\n",block->serdata,block->height,*(uint32_t *)&block->serdata[72]);
process_iguanablock(block->serdata,CHAINPARMS);
}*/
return(block); return(block);
} }
} }

5
iguana/iguana_recv.c

@ -399,6 +399,11 @@ void iguana_gotblockM(struct iguana_info *coin,struct iguana_peer *addr,struct i
} }
block->RO = origtxdata->block.RO; block->RO = origtxdata->block.RO;
block->txvalid = 1; block->txvalid = 1;
/*if ( block->serdata == 0 )
{
block->serdata = malloc(recvlen);
memcpy(block->serdata,data,recvlen);
}*/
//printf("update prev for [%d:%d]\n",bp->hdrsi,bundlei); //printf("update prev for [%d:%d]\n",bp->hdrsi,bundlei);
} }
} }

4
iguana/main.c

@ -65,7 +65,7 @@ int32_t USE_JAY,FIRST_EXTERNAL,IGUANA_disableNXT,Debuglevel,BIGENDIAN;
uint32_t prices777_NXTBLOCK,MAX_DEPTH = 100; uint32_t prices777_NXTBLOCK,MAX_DEPTH = 100;
queue_t helperQ,jsonQ,finishedQ,bundlesQ,emitQ; queue_t helperQ,jsonQ,finishedQ,bundlesQ,emitQ;
struct supernet_info MYINFO,**MYINFOS; struct supernet_info MYINFO,**MYINFOS;
static int32_t initflag; int32_t MAIN_initflag;
int32_t HDRnet,netBLOCKS; int32_t HDRnet,netBLOCKS;
cJSON *API_json; cJSON *API_json;
@ -1150,7 +1150,7 @@ void iguana_appletests(struct supernet_info *myinfo)
exit(-1); exit(-1);
} }
sleep(1);*/ sleep(1);*/
if ( 1 && (str= SuperNET_JSON(myinfo,cJSON_Parse("{\"RELAY\":1,\"VALIDATE\":1,\"prefetchlag\":-1,\"agent\":\"iguana\",\"method\":\"addcoin\",\"startpend\":500,\"endpend\":500,\"services\":0,\"maxpeers\":64,\"newcoin\":\"BTCD\",\"active\":1,\"numhelpers\":4,\"poll\":100}"),0,myinfo->rpcport)) != 0 ) if ( 1 && (str= SuperNET_JSON(myinfo,cJSON_Parse("{\"RELAY\":1,\"VALIDATE\":1,\"prefetchlag\":-1,\"agent\":\"iguana\",\"method\":\"addcoin\",\"startpend\":500,\"endpend\":500,\"services\":129,\"maxpeers\":64,\"newcoin\":\"BTCD\",\"active\":1,\"numhelpers\":4,\"poll\":100}"),0,myinfo->rpcport)) != 0 )
{ {
free(str); free(str);
if ( 0 && (str= SuperNET_JSON(myinfo,cJSON_Parse("{\"userhome\":\"/Users/jimbolaptop/Library/Application Support\",\"agent\":\"iguana\",\"method\":\"addcoin\",\"services\":1024,\"maxpeers\":256,\"newcoin\":\"BTCD\",\"active\":1}"),0,myinfo->rpcport)) != 0 ) if ( 0 && (str= SuperNET_JSON(myinfo,cJSON_Parse("{\"userhome\":\"/Users/jimbolaptop/Library/Application Support\",\"agent\":\"iguana\",\"method\":\"addcoin\",\"services\":1024,\"maxpeers\":256,\"newcoin\":\"BTCD\",\"active\":1}"),0,myinfo->rpcport)) != 0 )

9
pnacl_main.h

@ -16,7 +16,7 @@
#include <pthread.h> #include <pthread.h>
#endif #endif
static int initflag; int MAIN_initflag;
#ifndef __PNACL #ifndef __PNACL
#define PNACL_message printf #define PNACL_message printf
#else #else
@ -37,7 +37,7 @@ void *CHROMEAPP_NAME(void *arg)
#else #else
arg = 0; arg = 0;
#endif #endif
while ( initflag == 0 ) while ( MAIN_initflag == 0 )
usleep(1000000); usleep(1000000);
PNACL_message("%s start.(%s)\n",CHROMEAPP_STR,(char *)arg); PNACL_message("%s start.(%s)\n",CHROMEAPP_STR,(char *)arg);
CHROMEAPP_MAIN(arg); CHROMEAPP_MAIN(arg);
@ -370,7 +370,7 @@ static PP_Bool Instance_DidCreate(PP_Instance instance,uint32_t argc,const char*
0, // mountflags 0, // mountflags
""); // data*/ ""); // data*/
PNACL_message("finished DidCreate %s\n",CHROMEAPP_STR); PNACL_message("finished DidCreate %s\n",CHROMEAPP_STR);
initflag = 1; MAIN_initflag = 1;
return PP_TRUE; return PP_TRUE;
} }
@ -652,13 +652,14 @@ PSMainFunc_t PSUserMainGet()
} }
#else #else
int main(int argc, const char * argv[]) int main(int argc, const char * argv[])
{ {
char *jsonstr; char *jsonstr;
if ( argc < 2 ) if ( argc < 2 )
jsonstr = 0; jsonstr = 0;
else jsonstr = (char *)argv[1]; else jsonstr = (char *)argv[1];
initflag = 1; MAIN_initflag = 1;
OS_init(); OS_init();
printf("%s main\n",CHROMEAPP_STR); printf("%s main\n",CHROMEAPP_STR);
CHROMEAPP_NAME(jsonstr); CHROMEAPP_NAME(jsonstr);

Loading…
Cancel
Save