hush_userpass
This commit is contained in:
@@ -620,7 +620,7 @@ char *curl_post(CURL **cHandlep,char *url,char *userpass,char *postfields,char *
|
|||||||
return(chunk.memory);
|
return(chunk.memory);
|
||||||
}
|
}
|
||||||
|
|
||||||
uint16_t _komodo_userpass(char *username, char *password, FILE *fp)
|
uint16_t _hush_userpass(char *username, char *password, FILE *fp)
|
||||||
{
|
{
|
||||||
char *rpcuser,*rpcpassword,*str,*ipaddress,line[8192]; uint16_t port = 0;
|
char *rpcuser,*rpcpassword,*str,*ipaddress,line[8192]; uint16_t port = 0;
|
||||||
rpcuser = rpcpassword = 0;
|
rpcuser = rpcpassword = 0;
|
||||||
@@ -695,7 +695,7 @@ uint16_t _komodo_userpass(char *username, char *password, FILE *fp)
|
|||||||
//printf("test.(%s) -> [%s] statename.(%s) %s\n",test,ASSETCHAINS_SYMBOL,symbol,fname);
|
//printf("test.(%s) -> [%s] statename.(%s) %s\n",test,ASSETCHAINS_SYMBOL,symbol,fname);
|
||||||
}*/
|
}*/
|
||||||
|
|
||||||
uint16_t komodo_userpass(char *userpass,char *symbol)
|
uint16_t hush_userpass(char *userpass,char *symbol)
|
||||||
{
|
{
|
||||||
FILE *fp; uint16_t port = 0; char fname[512],username[512],password[512],confname[HUSH_SMART_CHAIN_MAXLEN];
|
FILE *fp; uint16_t port = 0; char fname[512],username[512],password[512],confname[HUSH_SMART_CHAIN_MAXLEN];
|
||||||
userpass[0] = 0;
|
userpass[0] = 0;
|
||||||
@@ -705,7 +705,7 @@ uint16_t komodo_userpass(char *userpass,char *symbol)
|
|||||||
//hush_statefname(fname,symbol,confname);
|
//hush_statefname(fname,symbol,confname);
|
||||||
if ( (fp= fopen(confname,"rb")) != 0 )
|
if ( (fp= fopen(confname,"rb")) != 0 )
|
||||||
{
|
{
|
||||||
port = _komodo_userpass(username,password,fp);
|
port = _hush_userpass(username,password,fp);
|
||||||
sprintf(userpass,"%s:%s",username,password);
|
sprintf(userpass,"%s:%s",username,password);
|
||||||
if ( strcmp(symbol,ASSETCHAINS_SYMBOL) == 0 )
|
if ( strcmp(symbol,ASSETCHAINS_SYMBOL) == 0 )
|
||||||
strcpy(USERPASS,userpass);
|
strcpy(USERPASS,userpass);
|
||||||
@@ -1001,7 +1001,7 @@ int main(int argc, char **argv, char **envp)
|
|||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
ROGUE_PORT = komodo_userpass(userpass,ASSETCHAINS_SYMBOL);
|
ROGUE_PORT = hush_userpass(userpass,ASSETCHAINS_SYMBOL);
|
||||||
if ( IPADDRESS[0] == 0 )
|
if ( IPADDRESS[0] == 0 )
|
||||||
strcpy(IPADDRESS,"127.0.0.1");
|
strcpy(IPADDRESS,"127.0.0.1");
|
||||||
printf("ASSETCHAINS_SYMBOL.(%s) port.%u (%s) IPADDRESS.%s \n",ASSETCHAINS_SYMBOL,ROGUE_PORT,USERPASS,IPADDRESS); sleep(1);
|
printf("ASSETCHAINS_SYMBOL.(%s) port.%u (%s) IPADDRESS.%s \n",ASSETCHAINS_SYMBOL,ROGUE_PORT,USERPASS,IPADDRESS); sleep(1);
|
||||||
|
|||||||
@@ -1295,7 +1295,7 @@ void dragon_initQ(queue_t *Q,char *name)
|
|||||||
free(item);
|
free(item);
|
||||||
}
|
}
|
||||||
|
|
||||||
uint16_t _komodo_userpass(char *username,char *password,FILE *fp)
|
uint16_t _hush_userpass(char *username,char *password,FILE *fp)
|
||||||
{
|
{
|
||||||
char *rpcuser,*rpcpassword,*str,line[8192]; uint16_t port = 0;
|
char *rpcuser,*rpcpassword,*str,line[8192]; uint16_t port = 0;
|
||||||
rpcuser = rpcpassword = 0;
|
rpcuser = rpcpassword = 0;
|
||||||
@@ -1404,7 +1404,7 @@ void hush_configfile(char *symbol,uint16_t rpcport)
|
|||||||
} else printf("Couldnt create (%s)\n",fname);
|
} else printf("Couldnt create (%s)\n",fname);
|
||||||
#endif
|
#endif
|
||||||
} else {
|
} else {
|
||||||
_komodo_userpass(myusername,mypassword,fp);
|
_hush_userpass(myusername,mypassword,fp);
|
||||||
mapArgs["-rpcpassword"] = mypassword;
|
mapArgs["-rpcpassword"] = mypassword;
|
||||||
mapArgs["-rpcusername"] = myusername;
|
mapArgs["-rpcusername"] = myusername;
|
||||||
//fprintf(stderr,"myusername.(%s)\n",myusername);
|
//fprintf(stderr,"myusername.(%s)\n",myusername);
|
||||||
@@ -1427,7 +1427,7 @@ void hush_configfile(char *symbol,uint16_t rpcport)
|
|||||||
#endif
|
#endif
|
||||||
if ( (fp= fopen(fname,"rb")) != 0 )
|
if ( (fp= fopen(fname,"rb")) != 0 )
|
||||||
{
|
{
|
||||||
if ( (kmdport= _komodo_userpass(username,password,fp)) != 0 )
|
if ( (kmdport= _hush_userpass(username,password,fp)) != 0 )
|
||||||
HUSH3_PORT = kmdport;
|
HUSH3_PORT = kmdport;
|
||||||
sprintf(HUSHUSERPASS,"%s:%s",username,password);
|
sprintf(HUSHUSERPASS,"%s:%s",username,password);
|
||||||
fclose(fp);
|
fclose(fp);
|
||||||
@@ -1437,7 +1437,7 @@ void hush_configfile(char *symbol,uint16_t rpcport)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
uint16_t komodo_userpass(char *userpass,char *symbol)
|
uint16_t hush_userpass(char *userpass,char *symbol)
|
||||||
{
|
{
|
||||||
FILE *fp; uint16_t port = 0; char fname[512],username[512],password[512],confname[HUSH_SMART_CHAIN_MAXLEN];
|
FILE *fp; uint16_t port = 0; char fname[512],username[512],password[512],confname[HUSH_SMART_CHAIN_MAXLEN];
|
||||||
userpass[0] = 0;
|
userpass[0] = 0;
|
||||||
@@ -1453,7 +1453,7 @@ uint16_t komodo_userpass(char *userpass,char *symbol)
|
|||||||
hush_statefname(fname,symbol,confname);
|
hush_statefname(fname,symbol,confname);
|
||||||
if ( (fp= fopen(fname,"rb")) != 0 )
|
if ( (fp= fopen(fname,"rb")) != 0 )
|
||||||
{
|
{
|
||||||
port = _komodo_userpass(username,password,fp);
|
port = _hush_userpass(username,password,fp);
|
||||||
sprintf(userpass,"%s:%s",username,password);
|
sprintf(userpass,"%s:%s",username,password);
|
||||||
if ( strcmp(symbol,SMART_CHAIN_SYMBOL) == 0 )
|
if ( strcmp(symbol,SMART_CHAIN_SYMBOL) == 0 )
|
||||||
strcpy(ASSETCHAINS_USERPASS,userpass);
|
strcpy(ASSETCHAINS_USERPASS,userpass);
|
||||||
@@ -2344,7 +2344,7 @@ void hush_args(char *argv0)
|
|||||||
{
|
{
|
||||||
fprintf(stderr,"Oh hellz yezzz\n");
|
fprintf(stderr,"Oh hellz yezzz\n");
|
||||||
}
|
}
|
||||||
if ( (port= komodo_userpass(ASSETCHAINS_USERPASS,SMART_CHAIN_SYMBOL)) != 0 )
|
if ( (port= hush_userpass(ASSETCHAINS_USERPASS,SMART_CHAIN_SYMBOL)) != 0 )
|
||||||
ASSETCHAINS_RPCPORT = port;
|
ASSETCHAINS_RPCPORT = port;
|
||||||
else hush_configfile(SMART_CHAIN_SYMBOL,ASSETCHAINS_P2PPORT + 1);
|
else hush_configfile(SMART_CHAIN_SYMBOL,ASSETCHAINS_P2PPORT + 1);
|
||||||
|
|
||||||
@@ -2421,7 +2421,7 @@ void hush_args(char *argv0)
|
|||||||
#endif
|
#endif
|
||||||
if ( (fp= fopen(fname,"rb")) != 0 )
|
if ( (fp= fopen(fname,"rb")) != 0 )
|
||||||
{
|
{
|
||||||
_komodo_userpass(username,password,fp);
|
_hush_userpass(username,password,fp);
|
||||||
sprintf(iter == 0 ? HUSHUSERPASS : BTCUSERPASS,"%s:%s",username,password);
|
sprintf(iter == 0 ? HUSHUSERPASS : BTCUSERPASS,"%s:%s",username,password);
|
||||||
fclose(fp);
|
fclose(fp);
|
||||||
//printf("HUSH.(%s) -> userpass.(%s)\n",fname,HUSHUSERPASS);
|
//printf("HUSH.(%s) -> userpass.(%s)\n",fname,HUSHUSERPASS);
|
||||||
|
|||||||
Reference in New Issue
Block a user