Browse Source

Test

etomic
jl777 8 years ago
parent
commit
1adb8552f7
  1. 4
      basilisk/jumblr.c
  2. 8
      basilisk/smartaddress.c
  3. 2
      iguana/iguana_wallet.c
  4. 2
      includes/iguana_funcs.h

4
basilisk/jumblr.c

@ -506,7 +506,7 @@ STRING_ARG(jumblr,setpassphrase,passphrase)
retjson = cJSON_CreateObject();
jaddstr(retjson,"result","success");
privkey = jumblr_privkey(myinfo,BTCaddr,KMDaddr,JUMBLR_DEPOSITPREFIX);
smartaddress_add(myinfo,privkey);
smartaddress_add(myinfo,privkey,BTCaddr,KMDaddr);
myinfo->jumblr_depositkey = curve25519(privkey,curve25519_basepoint9());
bitcoin_priv2wif(wifstr,privkey,coin->chain->wiftype);
if ( coin->FULLNODE < 0 )
@ -521,7 +521,7 @@ STRING_ARG(jumblr,setpassphrase,passphrase)
jaddnum(retjson,"BTCdeposits",dstr(jumblr_balance(myinfo,coinbtc,BTCaddr)));
}
privkey = jumblr_privkey(myinfo,BTCaddr,KMDaddr,"");
smartaddress_add(myinfo,privkey);
smartaddress_add(myinfo,privkey,BTCaddr,KMDaddr);
myinfo->jumblr_pubkey = curve25519(privkey,curve25519_basepoint9());
jaddstr(retjson,"KMDjumblr",KMDaddr);
jaddstr(retjson,"BTCjumblr",BTCaddr);

8
basilisk/smartaddress.c

@ -15,7 +15,7 @@
// included from basilisk.c
int32_t smartaddress_add(struct supernet_info *myinfo,bits256 privkey)
int32_t smartaddress_add(struct supernet_info *myinfo,bits256 privkey,char *BTCaddr,char *KMDaddr)
{
struct smartaddress *ap;
int32_t i;
@ -27,12 +27,12 @@ int32_t smartaddress_add(struct supernet_info *myinfo,bits256 privkey)
ap = &myinfo->smartaddrs[myinfo->numsmartaddrs++];
ap->privkey = privkey;
bitcoin_pubkey33(myinfo->ctx,ap->pubkey33,privkey);
ap->pubkey = curve25519(privkey,curve25519_basepoint9());
calc_rmd160(0,ap->rmd160,ap->pubkey33,33);
char coinaddr[64]; bitcoin_address(coinaddr,0,ap->rmd160,20);
ap->pubkey = curve25519(privkey,curve25519_basepoint9());
char coinaddr[64]; bitcoin_address(coinaddr,0,ap->pubkey33,33);
for (i=0; i<20; i++)
printf("%02x",ap->rmd160[i]);
printf (" <- rmd160 for %d %s\n",myinfo->numsmartaddrs,coinaddr);
printf (" <- rmd160 for %d %s vs %s\n",myinfo->numsmartaddrs,coinaddr,BTCaddr);
return(myinfo->numsmartaddrs);
}
printf("too many smartaddresses %d vs %d\n",myinfo->numsmartaddrs,(int32_t)(sizeof(myinfo->smartaddrs)/sizeof(*myinfo->smartaddrs)));

2
iguana/iguana_wallet.c

@ -1368,7 +1368,7 @@ TWOSTRINGS_AND_INT(bitcoinrpc,walletpassphrase,password,permanentfile,timeout)
}
}
if ( bits256_nonz(myinfo->persistent_priv) != 0 )
smartaddress_add(myinfo,myinfo->persistent_priv);
smartaddress_add(myinfo,myinfo->persistent_priv,"","");
//basilisk_unspents_update(myinfo,coin);
return(retstr);

2
includes/iguana_funcs.h

@ -597,7 +597,7 @@ void dpow_nanomsginit(struct supernet_info *myinfo,char *ipaddr);
int32_t iguana_datachain_scan(struct supernet_info *myinfo,struct iguana_info *coin,uint8_t rmd160[20]);
void basilisk_requests_poll(struct supernet_info *myinfo);
void dpow_psockloop(void *_ptr);
int32_t smartaddress_add(struct supernet_info *myinfo,bits256 privkey);
int32_t smartaddress_add(struct supernet_info *myinfo,bits256 privkey,char *BTCaddr,char *KMDaddr);
int32_t smartaddress(struct supernet_info *myinfo,bits256 *privkeyp,char *coinaddr);
int32_t smartaddress_pubkey(struct supernet_info *myinfo,bits256 *privkeyp,bits256 pubkey);
int32_t smartaddress_pubkey33(struct supernet_info *myinfo,bits256 *privkeyp,uint8_t *pubkey33);

Loading…
Cancel
Save