Browse Source

test

release/v0.1
jl777 8 years ago
parent
commit
44dff1cfe2
  1. 4
      iguana/SuperNET_keys.c
  2. 2
      iguana/iguana_rpc.c
  3. 2
      iguana/iguana_wallet.c

4
iguana/SuperNET_keys.c

@ -219,12 +219,12 @@ cJSON *SuperNET_decryptedjson(char *destfname,char *passphrase,int32_t passsize,
wallet2shared = SuperNET_wallet2shared(wallethash,wallet2priv); wallet2shared = SuperNET_wallet2shared(wallethash,wallet2priv);
wallet2pub = curve25519(wallet2shared,curve25519_basepoint9()); wallet2pub = curve25519(wallet2shared,curve25519_basepoint9());
sprintf(destfname,"%s/%s",GLOBAL_CONFSDIR,bits256_str(str,wallet2pub)); sprintf(destfname,"%s/%s",GLOBAL_CONFSDIR,bits256_str(str,wallet2pub));
printf("fname.(%s) wallet2pub.%s < [%s, %s]\n",destfname,bits256_str(str,wallet2pub),passphrase,fname2fa); //printf("fname.(%s) wallet2pub.%s < [%s, %s]\n",destfname,bits256_str(str,wallet2pub),passphrase,fname2fa);
if ( (confstr= OS_filestr(&allocsize,destfname)) != 0 ) if ( (confstr= OS_filestr(&allocsize,destfname)) != 0 )
{ {
if ( (filejson= cJSON_Parse(confstr)) != 0 ) if ( (filejson= cJSON_Parse(confstr)) != 0 )
{ {
printf("confstr.(%s)\n",confstr); //printf("confstr.(%s)\n",confstr);
if ( (deciphered= SuperNET_decipher(0,0,0,0,wallet2shared,curve25519(wallethash,curve25519_basepoint9()),jstr(filejson,"result"))) != 0 ) if ( (deciphered= SuperNET_decipher(0,0,0,0,wallet2shared,curve25519(wallethash,curve25519_basepoint9()),jstr(filejson,"result"))) != 0 )
{ {
if ( (json= cJSON_Parse(deciphered)) == 0 ) if ( (json= cJSON_Parse(deciphered)) == 0 )

2
iguana/iguana_rpc.c

@ -26,7 +26,7 @@ char *sglue(GLUEARGS,char *agent,char *method)
char *retstr,*rpcretstr,*walletstr,checkstr[64],dcheckstr[64]; cJSON *retjson,*tmpjson,*result,*error,*wallet; int32_t i,j,len; int64_t val; double dval; char *retstr,*rpcretstr,*walletstr,checkstr[64],dcheckstr[64]; cJSON *retjson,*tmpjson,*result,*error,*wallet; int32_t i,j,len; int64_t val; double dval;
if ( json == 0 ) if ( json == 0 )
json = cJSON_CreateObject(); json = cJSON_CreateObject();
printf("sglue.(%s)\n",jprint(json,0)); //printf("sglue.(%s)\n",jprint(json,0));
jaddstr(json,"agent",agent); jaddstr(json,"agent",agent);
jaddstr(json,"method",method); jaddstr(json,"method",method);
jaddstr(json,"coin",coin->symbol); jaddstr(json,"coin",coin->symbol);

2
iguana/iguana_wallet.c

@ -807,7 +807,7 @@ void iguana_walletinitcheck(struct supernet_info *myinfo,struct iguana_info *coi
cJSON *payload,*item,*array,*child; char *account,coinaddr[128],*privstr,wifstr[128]; int32_t i,p2shflag,n; struct iguana_waccount *wacct; struct iguana_waddress waddr; bits256 privkey; cJSON *payload,*item,*array,*child; char *account,coinaddr[128],*privstr,wifstr[128]; int32_t i,p2shflag,n; struct iguana_waccount *wacct; struct iguana_waddress waddr; bits256 privkey;
if ( myinfo->wallet == 0 && myinfo->decryptstr != 0 && (payload= cJSON_Parse(myinfo->decryptstr)) != 0 ) if ( myinfo->wallet == 0 && myinfo->decryptstr != 0 && (payload= cJSON_Parse(myinfo->decryptstr)) != 0 )
{ {
printf("WALLET.(%s)\n",myinfo->decryptstr); //printf("WALLET.(%s)\n",myinfo->decryptstr);
if ( (array= jobj(payload,"wallet")) != 0 ) if ( (array= jobj(payload,"wallet")) != 0 )
{ {
n = cJSON_GetArraySize(array); n = cJSON_GetArraySize(array);

Loading…
Cancel
Save