Browse Source

test

release/v0.1
jl777 9 years ago
parent
commit
44fc28d4aa
  1. 2
      iguana/iguana_peers.c
  2. 16
      iguana/main.c

2
iguana/iguana_peers.c

@ -711,7 +711,7 @@ uint32_t iguana_possible_peer(struct iguana_info *coin,char *ipaddr)
char checkaddr[64]; uint64_t ipbits; uint32_t now = (uint32_t)time(NULL); int32_t i,n; struct iguana_iAddr *iA;
if ( ipaddr != 0 )
{
//printf("%p Q possible peer.%s\n",coin,ipaddr);
printf("%p Q possible peer.%s\n",coin,ipaddr);
queue_enqueue("possibleQ",&coin->possibleQ,queueitem(ipaddr),1);
return((uint32_t)time(NULL));
}

16
iguana/main.c

@ -278,7 +278,7 @@ void sigcontinue_func() { printf("\nSIGCONT\n"); signal(SIGCONT,sigcontinue_func
void iguana_main(void *arg)
{
FILE *fp; cJSON *json; uint8_t *space,secretbuf[512],x; uint32_t r; long allocsize; bits256 pangeahash;
FILE *fp; cJSON *json; uint8_t *space,secretbuf[512]; uint32_t r; long allocsize; bits256 pangeahash;
char helperstr[64],fname[512],*wallet2,*wallet2str,*tmpstr,*confstr,*helperargs,*ipaddr,*coinargs=0,*secret,*jsonstr = arg;
struct supernet_info *myinfo;
int32_t i,len,flag,c; bits256 acct,seed,checkhash,wallethash,walletpub,wallet2shared,wallet2priv,wallet2pub;
@ -408,16 +408,6 @@ void iguana_main(void *arg)
strcpy(myinfo->ipaddr,"127.0.0.1");
myinfo->myaddr.selfipbits = (uint32_t)calc_ipbits(myinfo->ipaddr);
}
#ifdef __APPLE__
x = 1;
#else
x = 0;
#endif
while ( myinfo->myaddr.pubkey.bytes[0] != x )
{
OS_randombytes(myinfo->privkey.bytes,sizeof(myinfo->privkey));
myinfo->myaddr.pubkey = curve25519(myinfo->privkey,curve25519_basepoint9());
}
vcalc_sha256(0,acct.bytes,(void *)myinfo->myaddr.persistent.bytes,sizeof(bits256));
myinfo->myaddr.nxt64bits = acct.txid;
RS_encode(myinfo->myaddr.NXTADDR,myinfo->myaddr.nxt64bits);
@ -490,12 +480,12 @@ void iguana_main(void *arg)
iguana_launch(iguana_coinadd("BTCD"),"rpcloop",iguana_rpcloop,SuperNET_MYINFO(0),IGUANA_PERMTHREAD);
if ( coinargs != 0 )
iguana_launch(iguana_coinadd("BTCD"),"iguana_coins",iguana_coins,coinargs,IGUANA_PERMTHREAD);
else if ( 0 )
else if ( 1 )
{
#ifdef __APPLE__
sleep(1);
char *str;
if ( (str= SuperNET_JSON(&MYINFO,cJSON_Parse("{\"wallet\":\"password\",\"agent\":\"iguana\",\"method\":\"addcoin\",\"services\":128,\"maxpeers\":64,\"newcoin\":\"BTCD\",\"active\":1}"),0)) != 0 )
if ( (str= SuperNET_JSON(&MYINFO,cJSON_Parse("{\"wallet\":\"password\",\"agent\":\"iguana\",\"method\":\"addcoin\",\"services\":128,\"maxpeers\":3,\"newcoin\":\"BTCD\",\"active\":0}"),0)) != 0 )
{
printf("got.(%s)\n",str);
free(str);

Loading…
Cancel
Save