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. 2
      iguana/iguana_msg.c
  9. 5
      iguana/iguana_recv.c
  10. 4
      iguana/main.c
  11. 9
      pnacl_main.h

BIN
agents/iguana

Binary file not shown.

2
crypto777/bitcoind_RPC.c

@ -15,7 +15,7 @@
#include "OS_portable.h"
#define USE_CURL
//#define USE_CURL
#ifdef USE_CURL
#ifdef _WIN32
#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);
return(0);
}

2
iguana/iguana777.h

@ -302,7 +302,7 @@ struct iguana_block
double PoW; // NOT consensus safe, for estimation purposes only
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;
UT_hash_handle hh; struct iguana_bundlereq *req;
UT_hash_handle hh; struct iguana_bundlereq *req; //void *serdata;
} __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);
}
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)
{
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;
/*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);
}
}

2
iguana/iguana_msg.c

@ -88,7 +88,7 @@ int32_t iguana_rwblock(int32_t rwflag,bits256 *hash2p,uint8_t *serialized,struct
len += iguana_rwnum(rwflag,&serialized[len],sizeof(msg->H.bits),&msg->H.bits);
len += iguana_rwnum(rwflag,&serialized[len],sizeof(msg->H.nonce),&msg->H.nonce);
*hash2p = bits256_doublesha256(blockhash,serialized,len);
//char str[65]; printf("len.%d: block version.%d timestamp.%u bits.%x nonce.%u prev.(%s) %llx blockhash.(%s) %llx\n",len,msg->H.version,msg->H.timestamp,msg->H.bits,msg->H.nonce,bits256_str(str,msg->H.prev_block),(long long)msg->H.merkle_root.txid,blockhash,(long long)hash2p->txid);
// char str[65]; printf("len.%d: block version.%d timestamp.%u bits.%x nonce.%u prev.(%s) %llx blockhash.(%s) %llx\n",len,msg->H.version,msg->H.timestamp,msg->H.bits,msg->H.nonce,bits256_str(str,msg->H.prev_block),(long long)msg->H.merkle_root.txid,blockhash,(long long)hash2p->txid);
if ( rwflag != 0 )
x = msg->txn_count;
len += iguana_rwvarint(rwflag,&serialized[len],&x);

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->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);
}
}

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;
queue_t helperQ,jsonQ,finishedQ,bundlesQ,emitQ;
struct supernet_info MYINFO,**MYINFOS;
static int32_t initflag;
int32_t MAIN_initflag;
int32_t HDRnet,netBLOCKS;
cJSON *API_json;
@ -1150,7 +1150,7 @@ void iguana_appletests(struct supernet_info *myinfo)
exit(-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);
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>
#endif
static int initflag;
int MAIN_initflag;
#ifndef __PNACL
#define PNACL_message printf
#else
@ -37,7 +37,7 @@ void *CHROMEAPP_NAME(void *arg)
#else
arg = 0;
#endif
while ( initflag == 0 )
while ( MAIN_initflag == 0 )
usleep(1000000);
PNACL_message("%s start.(%s)\n",CHROMEAPP_STR,(char *)arg);
CHROMEAPP_MAIN(arg);
@ -370,7 +370,7 @@ static PP_Bool Instance_DidCreate(PP_Instance instance,uint32_t argc,const char*
0, // mountflags
""); // data*/
PNACL_message("finished DidCreate %s\n",CHROMEAPP_STR);
initflag = 1;
MAIN_initflag = 1;
return PP_TRUE;
}
@ -652,13 +652,14 @@ PSMainFunc_t PSUserMainGet()
}
#else
int main(int argc, const char * argv[])
{
char *jsonstr;
if ( argc < 2 )
jsonstr = 0;
else jsonstr = (char *)argv[1];
initflag = 1;
MAIN_initflag = 1;
OS_init();
printf("%s main\n",CHROMEAPP_STR);
CHROMEAPP_NAME(jsonstr);

Loading…
Cancel
Save