From 2bf7b29ea9585b84fb6385efab83e2ac309278bd Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 6 Jan 2017 17:05:12 +0200 Subject: [PATCH] test --- iguana/SuperNET_keys.c | 9 --------- iguana/iguana_rpc.c | 1 - iguana/iguana_wallet.c | 2 -- 3 files changed, 12 deletions(-) diff --git a/iguana/SuperNET_keys.c b/iguana/SuperNET_keys.c index 577907b5f..9eadf21f0 100755 --- a/iguana/SuperNET_keys.c +++ b/iguana/SuperNET_keys.c @@ -84,7 +84,6 @@ bits256 SuperNET_wallet2priv(char *wallet2fname,bits256 wallethash) wallet2str[i] ^= wallethash.bytes[(i + r) % 32]; vcalc_sha256(0,wallet2priv.bytes,(void *)wallet2str,(int32_t)allocsize); free(wallet2str); - //char str[65]; printf("wallet2priv.(%s) from.(%s) crc.%u and passphrase r.%d len.%ld\n",bits256_str(str,wallet2priv),wallet2fname,crc,r,allocsize); } else if ( wallet2fname[0] != 0 ) printf("SuperNET_wallet2priv cant open (%s)\n",wallet2fname); return(wallet2priv); @@ -248,7 +247,6 @@ cJSON *SuperNET_decryptedjson(char *destfname,char *passphrase,int32_t passsize, wallethash = SuperNET_linehash(passphrase); SuperNET_linehash(fname2fa); // maps special chars wallet2priv = SuperNET_wallet2priv(fname2fa,wallethash); - //char str[65],str2[65]; printf("(%s + %s) -> wallethash.%s 2.(%s)\n",passphrase,fname2fa,bits256_str(str,wallethash),bits256_str(str2,wallet2priv)); } first = (bits256_nonz(wallethash) != 0 && bits256_cmp(wallethash,GENESIS_PRIVKEY) != 0); second = (bits256_nonz(wallet2priv) != 0 && bits256_cmp(wallet2priv,GENESIS_PRIVKEY) != 0); @@ -259,7 +257,6 @@ cJSON *SuperNET_decryptedjson(char *destfname,char *passphrase,int32_t passsize, wallet2shared = SuperNET_wallet2shared(wallethash,wallet2priv); wallet2pub = curve25519(wallet2shared,curve25519_basepoint9()); 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); if ( (confstr= OS_filestr(&allocsize,destfname)) != 0 ) { if ( (filejson= cJSON_Parse(confstr)) != 0 ) @@ -305,12 +302,9 @@ int32_t _SuperNET_encryptjson(struct supernet_info *myinfo,char *destfname,char wallethash = SuperNET_linehash(passphrase); SuperNET_linehash(fname2fa); // maps special chars wallet2priv = SuperNET_wallet2priv(fname2fa,wallethash); - //char str2[65]; printf("ENCRYPT.[%s %s] (%s) 2.%s\n",passphrase,fname2fa,bits256_str(str,wallethash),bits256_str(str2,wallet2priv)); wallet2shared = SuperNET_wallet2shared(wallethash,wallet2priv); wallet2pub = curve25519(wallet2shared,curve25519_basepoint9()); sprintf(destfname,"%s/%s",GLOBAL_CONFSDIR,bits256_str(str,wallet2pub)); - //printf("SAVE ARGJSON.(%s) [%s, %s] -> destfname.(%s)\n",jprint(argjson,0),passphrase,fname2fa,destfname); - //printf("shared.%llx -> pub.%s\n",(long long)wallet2shared.txid,bits256_str(str,wallet2pub)); SuperNET_savejsonfile(myinfo,destfname,wallethash,wallet2pub,argjson); return(0); } @@ -375,7 +369,6 @@ char *SuperNET_keysinit(struct supernet_info *myinfo,char *argjsonstr) passphrase[0] = fname2fa[0] = 0; wallethash = wallet2priv = GENESIS_PRIVKEY; coinargs = SuperNET_parsemainargs(myinfo,&wallethash,&wallet2priv,argjsonstr); - //printf("wallethash.%s 2.(%s)\n",bits256_str(str,wallethash),bits256_str(str2,wallet2priv)); if ( (msgjson= SuperNET_decryptedjson(destfname,passphrase,sizeof(passphrase),wallethash,fname2fa,sizeof(fname2fa),wallet2priv)) != 0 ) { SuperNET_parsemyinfo(myinfo,msgjson); @@ -395,9 +388,7 @@ char *SuperNET_keysinit(struct supernet_info *myinfo,char *argjsonstr) jaddbits256(json,"persistent_pub",myinfo->myaddr.persistent); OS_randombytes((void *)&r,sizeof(r)); jadd64bits(json,"rand",r); - //printf("call SuperNET_encryptjson\n"); _SuperNET_encryptjson(myinfo,destfname,passphrase,sizeof(passphrase),fname2fa,sizeof(fname2fa),json); - //printf("save.(%s)\n",jprint(json,0)); free_json(json); } if ( myinfo->ipaddr[0] == 0 ) diff --git a/iguana/iguana_rpc.c b/iguana/iguana_rpc.c index cc5eaf831..c36a6bce7 100755 --- a/iguana/iguana_rpc.c +++ b/iguana/iguana_rpc.c @@ -52,7 +52,6 @@ char *sglue(GLUEARGS,char *agent,char *method) { if ( (wallet= iguana_walletjson(myinfo)) != 0 ) { - //printf("WALLETSTR.(%s)\n",jprint(wallet,0)); if ( (walletstr= SuperNET_login(myinfo,coin,json,remoteaddr,myinfo->handle,myinfo->secret,myinfo->permanentfile,0)) != 0 ) { free(walletstr); diff --git a/iguana/iguana_wallet.c b/iguana/iguana_wallet.c index cfa8a8d4e..14c8aadc6 100755 --- a/iguana/iguana_wallet.c +++ b/iguana/iguana_wallet.c @@ -1505,12 +1505,10 @@ TWOSTRINGS_AND_INT(bitcoinrpc,importprivkey,wif,account,rescan) { free(retstr); retstr = myinfo->decryptstr, myinfo->decryptstr = 0; - //printf("DECRYPT.(%s)\n",retstr); iguana_waddresscalc(myinfo,coin->chain->pubtype,coin->chain->wiftype,waddr,privkey); iguana_waccountswitch(myinfo,coin,account,waddr->coinaddr,0); waddr->privkey = privkey; retjson = iguana_walletadd(myinfo,0,coin,retstr,account,waddr,0,0); - //printf("AFTERADD.(%s)\n",jprint(retjson,0)); if ( retstr != 0 ) scrubfree(retstr); return(jprint(retjson,1));