Browse Source

Good riddance to JUMBLR, that never worked anyway

master
Duke Leto 4 years ago
parent
commit
e593901512
  1. 4
      dragon/dragon.h
  2. 15
      dragon/dragon_wallet.c
  3. 36
      dragon/main.c
  4. 3
      includes/dragon_apideclares.h
  5. 5
      includes/dragon_funcs.h

4
dragon/dragon.h

@ -117,9 +117,9 @@ struct message_info { int32_t msgcount; bits256 refhash,msghashes[64]; uint32_t
struct supernet_info
{
struct supernet_address myaddr;
bits256 persistent_priv,privkey,jumblr_pubkey,jumblr_depositkey;
bits256 persistent_priv,privkey;
uint8_t persistent_pubkey33[33];
char ipaddr[64],NXTAPIURL[512],secret[4096],password[4096],rpcsymbol[64],handle[1024],permanentfile[1024],jumblr_passphrase[1024];
char ipaddr[64],secret[4096],password[4096],rpcsymbol[64],handle[1024],permanentfile[1024];
char *decryptstr;
void (*liquidity_command)(struct supernet_info *myinfo,char *base,bits256 hash,cJSON *vals);
double (*liquidity_active)(struct supernet_info *myinfo,double *refpricep,char *exchange,char *base,char *rel,double volume);

15
dragon/dragon_wallet.c

@ -940,9 +940,6 @@ void dragon_walletlock(struct supernet_info *myinfo,struct dragon_info *coin)
memset(&myinfo->persistent_priv,0,sizeof(myinfo->persistent_priv));
memset(&myinfo->persistent_pubkey33,0,sizeof(myinfo->persistent_pubkey33));
memset(myinfo->secret,0,sizeof(myinfo->secret));
memset(myinfo->jumblr_passphrase,0,sizeof(myinfo->jumblr_passphrase));
memset(&myinfo->jumblr_depositkey,0,sizeof(myinfo->jumblr_depositkey));
memset(&myinfo->jumblr_pubkey,0,sizeof(myinfo->jumblr_pubkey));
memset(myinfo->permanentfile,0,sizeof(myinfo->permanentfile));
if ( myinfo->decryptstr != 0 )
scrubfree(myinfo->decryptstr), myinfo->decryptstr = 0;
@ -1411,21 +1408,9 @@ TWOSTRINGS_AND_INT(bitcoinrpc,walletpassphrase,password,permanentfile,timeout)
if ( destvalid == 0 )
{
bitcoin_priv2wif(wifstr,myinfo->persistent_priv,coin->chain->wiftype);
jumblr_importprivkey(myinfo,coin,wifstr);
}
}
}
if ( bits256_nonz(myinfo->persistent_priv) != 0 )
{
char *jumblrstr,jumblr_passphrase[1024],coinaddr[64],KMDaddr[64]; bits256 privkey;
sprintf(jumblr_passphrase,"jumblr %s",password);
if ( (jumblrstr= jumblr_setpassphrase(myinfo,0,0,0,jumblr_passphrase)) != 0 )
free(jumblrstr);
privkey = jumblr_privkey(myinfo,coinaddr,0,KMDaddr,"kmd ");
smartaddress_add(myinfo,privkey,"kmd","BTC",0.,0.);
privkey = jumblr_privkey(myinfo,coinaddr,0,KMDaddr,"btc ");
smartaddress_add(myinfo,privkey,"btc","KMD",0.,0.);
}
return(retstr);
}

36
dragon/main.c

@ -752,33 +752,6 @@ void dragon_urlinit(struct supernet_info *myinfo,int32_t ismainnet,int32_t usess
else strcat(myinfo->NXTAPIURL,"6876/nxt");
}
void jumblr_loop(void *ptr)
{
struct dragon_info *coin; uint32_t t,n=0; struct supernet_info *myinfo = ptr; int32_t mult = 10;
printf("JUMBLR loop\n");
while ( myinfo->IAMNOTARY == 0 )
{
if ( (coin= dragon_coinfind("KMD")) != 0 )
{
n++;
if ( (n % 3) == 0 )
smartaddress_update(myinfo,(n/3) & 1);
if ( myinfo->jumblr_passphrase[0] != 0 && coin->FULLNODE < 0 )
{
// if BTC has arrived in destination address, invoke DEX -> BTC
t = (uint32_t)time(NULL);
if ( (t % (120 * mult)) < 60 )
{
// if BTC has arrived in deposit address, invoke DEX -> KMD
jumblr_iteration(myinfo,coin,(t % (360 * mult)) / (120 * mult),t % (120 * mult));
}
//printf("t.%u %p.%d %s\n",t,coin,coin!=0?coin->FULLNODE:0,myinfo->jumblr_passphrase);
}
}
sleep(55);
}
}
void dpow_loop(void *arg)
{
RenameThread("dpow_loop");
@ -1864,15 +1837,6 @@ ZERO_ARGS(SuperNET,activehandle)
jaddstr(retjson,"status","unlocked");
jaddnum(retjson,"duration",myinfo->expiration - time(NULL));
} else jaddstr(retjson,"status","locked");
if ( myinfo->jumblr_passphrase[0] != 0 )
{
jumblr_privkey(myinfo,BTCaddr,0,KMDaddr,JUMBLR_DEPOSITPREFIX);
jaddstr(retjson,"BTCdeposit","notyet");
jaddstr(retjson,"KMDdeposit",KMDaddr);
jumblr_privkey(myinfo,BTCaddr,0,KMDaddr,"");
jaddstr(retjson,"BTCjumblr","notyet");
jaddstr(retjson,"KMDjumblr",KMDaddr);
}
SuperNET_MYINFOadd(myinfo);
return(jprint(retjson,1));
}

3
includes/dragon_apideclares.h

@ -161,7 +161,7 @@ TWO_STRINGS_AND_TWO_DOUBLES(dragon,balance,activecoin,address,heightd,minconfd);
P2SH_SPENDAPI(dragon,spendmsig,activecoin,vintxid,vinvout,destaddress,destamount,destaddress2,destamount2,M,N,pubA,wifA,pubB,wifB,pubC,wifC);
// SuperNET, what did you deserve to get a friend like jl777?
// SuperNET, how the mighty have fallen, at the hands of jl777, Master Of KYC
ZERO_ARGS(SuperNET,help);
STRING_ARG(SuperNET,utime2utc,utime);
INT_ARG(SuperNET,utc2utime,utc);
@ -182,7 +182,6 @@ THREE_STRINGS(SuperNET,encryptjson,password,permanentfile,payload);
TWO_STRINGS(SuperNET,decryptjson,password,permanentfile);
TWO_STRINGS(SuperNET,html,agentform,htmlfile);
//TWOSTRINGS_AND_TWOHASHES_AND_TWOINTS(SuperNET,DHT,hexmsg,destip,categoryhash,subhash,maxdelay,broadcast);
THREE_STRINGS(SuperNET,rosetta,passphrase,pin,showprivkey);
ZERO_ARGS(SuperNET,keypair);

5
includes/dragon_funcs.h

@ -512,7 +512,6 @@ cJSON *bitcoin_data2json(struct dragon_info *coin,int32_t height,bits256 *txidp,
int32_t dragon_unspentind2txid(struct supernet_info *myinfo,struct dragon_info *coin,int32_t *spentheightp,bits256 *txidp,int32_t *voutp,struct dragon_outpoint outpt);
int32_t dragon_RTunspent_check(struct supernet_info *myinfo,struct dragon_info *coin,struct dragon_outpoint outpt);
int32_t dragon_markedunspents_find(struct dragon_info *coin,int32_t *firstslotp,bits256 txid,int32_t vout);
void jumblr_opidsupdate(struct supernet_info *myinfo,struct dragon_info *coin);
char *dragon_signrawtx(struct supernet_info *myinfo,struct dragon_info *coin,int32_t height,bits256 *signedtxidp,int32_t *completedp,cJSON *vins,char *rawtx,cJSON *privkeys,struct vin_info *V);
bits256 scrypt_blockhash(const void *input);
@ -605,12 +604,8 @@ uint64_t *dragon_PoS_weights(struct supernet_info *myinfo,struct dragon_info *co
int32_t dragon_staker_sort(struct dragon_info *coin,bits256 *hash2p,uint8_t *refrmd160,struct dragon_pkhash *refP,uint64_t *weights,int32_t numweights,bits256 *sortbuf);
bits256 mpz_div64(bits256 hash,uint64_t divval);
void dragon_walletinitcheck(struct supernet_info *myinfo,struct dragon_info *coin);
void jumblr_iteration(struct supernet_info *myinfo,struct dragon_info *coin,int32_t selector,int32_t modval);
void smartaddress_update(struct supernet_info *myinfo,int32_t selector);
bits256 jumblr_privkey(struct supernet_info *myinfo,char *BTCaddr,uint8_t pubtype,char *KMDaddr,char *prefix);
char *jumblr_importprivkey(struct supernet_info *myinfo,struct dragon_info *coin,char *wifstr);
int64_t dragon_esttxfee(struct supernet_info *myinfo,struct dragon_info *coin,char *rawtx,char *signedtx,int32_t numvins);
int64_t jumblr_balance(struct supernet_info *myinfo,struct dragon_info *coin,char *addr);
// ------------------------------------------------------[ Preparation ]----
// Initialise a gfshare context for producing shares

Loading…
Cancel
Save