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