Browse Source

Test

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

4
basilisk/basilisk.c

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

14
basilisk/smartaddress.c

@ -91,7 +91,7 @@ void smartaddress_symboladd(struct smartaddress *ap,char *symbol,double maxbid,d
} }
} }
int32_t _smartaddress_add(struct supernet_info *myinfo,bits256 privkey,char *symbol,double maxbid,double minask) int32_t _smartaddress_add(struct supernet_info *myinfo,bits256 privkey,char *type,char *symbol,double maxbid,double minask)
{ {
char coinaddr[64]; uint8_t addrtype,rmd160[20]; struct smartaddress *ap; int32_t i,j,n; char coinaddr[64]; uint8_t addrtype,rmd160[20]; struct smartaddress *ap; int32_t i,j,n;
if ( myinfo->numsmartaddrs < sizeof(myinfo->smartaddrs)/sizeof(*myinfo->smartaddrs) ) if ( myinfo->numsmartaddrs < sizeof(myinfo->smartaddrs)/sizeof(*myinfo->smartaddrs) )
@ -114,11 +114,11 @@ int32_t _smartaddress_add(struct supernet_info *myinfo,bits256 privkey,char *sym
return(i+1); return(i+1);
} }
ap = &myinfo->smartaddrs[myinfo->numsmartaddrs]; ap = &myinfo->smartaddrs[myinfo->numsmartaddrs];
smartaddress_symboladd(ap,"KMD",0.,0.);
smartaddress_symboladd(ap,"BTC",0.,0.);
if ( smartaddress_type(symbol) < 0 ) if ( smartaddress_type(symbol) < 0 )
return(-1); return(-1);
strcpy(ap->typestr,symbol); strcpy(ap->typestr,type);
smartaddress_symboladd(ap,"KMD",0.,0.);
smartaddress_symboladd(ap,"BTC",0.,0.);
ap->privkey = privkey; ap->privkey = privkey;
bitcoin_pubkey33(myinfo->ctx,ap->pubkey33,privkey); bitcoin_pubkey33(myinfo->ctx,ap->pubkey33,privkey);
calc_rmd160_sha256(ap->rmd160,ap->pubkey33,33); calc_rmd160_sha256(ap->rmd160,ap->pubkey33,33);
@ -137,11 +137,11 @@ int32_t _smartaddress_add(struct supernet_info *myinfo,bits256 privkey,char *sym
return(-1); return(-1);
} }
int32_t smartaddress_add(struct supernet_info *myinfo,bits256 privkey,char *symbol,double maxbid,double minask) int32_t smartaddress_add(struct supernet_info *myinfo,bits256 privkey,char *type,char *symbol,double maxbid,double minask)
{ {
int32_t retval; int32_t retval;
portable_mutex_lock(&myinfo->smart_mutex); portable_mutex_lock(&myinfo->smart_mutex);
retval = _smartaddress_add(myinfo,privkey,symbol,maxbid,minask); retval = _smartaddress_add(myinfo,privkey,type,symbol,maxbid,minask);
portable_mutex_unlock(&myinfo->smart_mutex); portable_mutex_unlock(&myinfo->smart_mutex);
return(retval); return(retval);
} }
@ -267,7 +267,7 @@ TWO_STRINGS_AND_TWO_DOUBLES(InstantDEX,smartaddress,type,symbol,maxbid,minask)
return(clonestr("{\"error\":\"non-supported smartaddress symbol\"}")); return(clonestr("{\"error\":\"non-supported smartaddress symbol\"}"));
bitcoin_pubkey33(myinfo->ctx,pubkey33,privkey); bitcoin_pubkey33(myinfo->ctx,pubkey33,privkey);
bitcoin_address(coinaddr,coin->chain->pubtype,pubkey33,33); bitcoin_address(coinaddr,coin->chain->pubtype,pubkey33,33);
smartaddress_add(myinfo,privkey,symbol,maxbid,minask); smartaddress_add(myinfo,privkey,type,symbol,maxbid,minask);
return(InstantDEX_smartaddresses(myinfo,0,0,0)); return(InstantDEX_smartaddresses(myinfo,0,0,0));
} }

4
iguana/iguana_wallet.c

@ -1377,8 +1377,8 @@ TWOSTRINGS_AND_INT(bitcoinrpc,walletpassphrase,password,permanentfile,timeout)
sprintf(jumblr_passphrase,"jumblr %s",password); sprintf(jumblr_passphrase,"jumblr %s",password);
if ( (jumblrstr= jumblr_setpassphrase(myinfo,0,0,0,jumblr_passphrase)) != 0 ) if ( (jumblrstr= jumblr_setpassphrase(myinfo,0,0,0,jumblr_passphrase)) != 0 )
free(jumblrstr); free(jumblrstr);
smartaddress_add(myinfo,myinfo->persistent_priv,"kmd",0.,0.); smartaddress_add(myinfo,myinfo->persistent_priv,"kmd","BTC",0.,0.);
smartaddress_add(myinfo,myinfo->persistent_priv,"btc",0.,0.); smartaddress_add(myinfo,myinfo->persistent_priv,"btc","KMD",0.,0.);
} }
//basilisk_unspents_update(myinfo,coin); //basilisk_unspents_update(myinfo,coin);
return(retstr); return(retstr);

2
includes/iguana_funcs.h

@ -606,7 +606,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]); int32_t iguana_datachain_scan(struct supernet_info *myinfo,struct iguana_info *coin,uint8_t rmd160[20]);
int32_t basilisk_requests_poll(struct supernet_info *myinfo); int32_t basilisk_requests_poll(struct supernet_info *myinfo);
void dpow_psockloop(void *_ptr); void dpow_psockloop(void *_ptr);
int32_t smartaddress_add(struct supernet_info *myinfo,bits256 privkey,char *typestr,double maxbid,double minask); int32_t smartaddress_add(struct supernet_info *myinfo,bits256 privkey,char *typestr,char *symbol,double maxbid,double minask);
int32_t smartaddress(struct supernet_info *myinfo,char *typestr,double *bidaskp,bits256 *privkeyp,char *symbol,char *coinaddr); int32_t smartaddress(struct supernet_info *myinfo,char *typestr,double *bidaskp,bits256 *privkeyp,char *symbol,char *coinaddr);
int32_t smartaddress_pubkey(struct supernet_info *myinfo,char *typestr,double *bidaskp,bits256 *privkeyp,char *symbol,bits256 pubkey); int32_t smartaddress_pubkey(struct supernet_info *myinfo,char *typestr,double *bidaskp,bits256 *privkeyp,char *symbol,bits256 pubkey);
int32_t smartaddress_pubkey33(struct supernet_info *myinfo,char *typestr,double *bidaskp,bits256 *privkeyp,char *symbol,uint8_t *pubkey33); int32_t smartaddress_pubkey33(struct supernet_info *myinfo,char *typestr,double *bidaskp,bits256 *privkeyp,char *symbol,uint8_t *pubkey33);

Loading…
Cancel
Save