Browse Source

Merge pull request #280 from jl777/dev

Dev
win-cross
jl777 8 years ago
committed by GitHub
parent
commit
bf352b9a29
  1. 9
      basilisk/jumblr.c
  2. 1
      iguana/iguana777.h
  3. 11
      iguana/main.c
  4. 2
      iguana/tests/jumblrstatus
  5. 1
      includes/iguana_funcs.h

9
basilisk/jumblr.c

@ -32,7 +32,6 @@
#define JUMBLR_ADDR "RGhxXpXSSBTBm9EvNsXnTQczthMCxHX91t"
#define JUMBLR_BTCADDR "18RmTJe9qMech8siuhYfMtHo8RtcN1obC6"
#define JUMBLR_FEE 0.001
#define JUMBLR_DEPOSITPREFIX "deposit "
struct jumblr_item *jumblr_opidfind(struct supernet_info *myinfo,char *opid)
{
@ -68,7 +67,7 @@ char *jumblr_zlistoperationids(struct supernet_info *myinfo,struct iguana_info *
char *jumblr_zgetoperationresult(struct supernet_info *myinfo,struct iguana_info *coin,char *opid)
{
char params[1024];
sprintf(params,"[\"%s\"]",opid);
sprintf(params,"[[\"%s\"]]",opid);
return(bitcoind_passthru(coin->symbol,coin->chain->serverport,coin->chain->userpass,"z_getoperationresult",params));
}
@ -254,7 +253,7 @@ r = 0;
printf("JUMBLR selector.%d modval.%d r.%d\n",selector,modval,r&7);
switch ( selector )
{
case 0: // public -> z
case 0: // public -> z, need to importprivkey
priv0 = jumblr_privkey(myinfo,BTCaddr,KMDaddr,JUMBLR_DEPOSITPREFIX);
if ( (total= jumblr_balance(myinfo,coin,KMDaddr)) >= (JUMBLR_INCR + 3*(fee+JUMBLR_TXFEE))*SATOSHIDEN )
{
@ -356,8 +355,12 @@ ZERO_ARGS(jumblr,status)
retjson = cJSON_CreateObject();
step_t2z = step_z2z = step_z2t = deposited = finished = 0;
jumblr_privkey(myinfo,BTCaddr,KMDaddr,JUMBLR_DEPOSITPREFIX);
jaddstr(retjson,"BTCdeposit","notyet");
jaddstr(retjson,"KMDdeposit",KMDaddr);
deposited = jumblr_receivedby(myinfo,coin,KMDaddr);
jumblr_privkey(myinfo,BTCaddr,KMDaddr,"");
jaddstr(retjson,"BTCjumblr","notyet");
jaddstr(retjson,"KMDjumblr",KMDaddr);
finished = jumblr_receivedby(myinfo,coin,KMDaddr);
HASH_ITER(hh,myinfo->jumblrs,ptr,tmp)
{

1
iguana/iguana777.h

@ -90,6 +90,7 @@ struct supernet_address
struct pending_trade { UT_hash_handle hh; double basevolume,relvolume,dir; char base[32],rel[32]; };
#define JUMBLR_DEPOSITPREFIX "deposit "
struct jumblr_item
{
UT_hash_handle hh;

11
iguana/main.c

@ -1452,7 +1452,7 @@ ZERO_ARGS(SuperNET,logout)
ZERO_ARGS(SuperNET,activehandle)
{
cJSON *retjson;
cJSON *retjson; char BTCaddr[64],KMDaddr[64];
if ( remoteaddr != 0 )
return(clonestr("{\"error\":\"no remote\"}"));
retjson = SuperNET_rosettajson(myinfo,myinfo->persistent_priv,0);
@ -1468,6 +1468,15 @@ 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,KMDaddr,JUMBLR_DEPOSITPREFIX);
jaddstr(retjson,"BTCdeposit","notyet");
jaddstr(retjson,"KMDdeposit",KMDaddr);
jumblr_privkey(myinfo,BTCaddr,KMDaddr,"");
jaddstr(retjson,"BTCjumblr","notyet");
jaddstr(retjson,"KMDjumblr",KMDaddr);
}
SuperNET_MYINFOadd(myinfo);
return(jprint(retjson,1));
}

2
iguana/tests/jumblrstatus

@ -0,0 +1,2 @@
#!/bin/bash
curl --url "http://127.0.0.1:7778" --data "{\"agent\":\"jumblr\",\"method\":\"status\"}"

1
includes/iguana_funcs.h

@ -615,6 +615,7 @@ int32_t iguana_staker_sort(struct iguana_info *coin,bits256 *hash2p,uint8_t *ref
bits256 mpz_div64(bits256 hash,uint64_t divval);
void iguana_walletinitcheck(struct supernet_info *myinfo,struct iguana_info *coin);
void jumblr_iteration(struct supernet_info *myinfo,struct iguana_info *coin,int32_t selector,int32_t modval);
bits256 jumblr_privkey(struct supernet_info *myinfo,char *BTCaddr,char *KMDaddr,char *prefix);
// ------------------------------------------------------[ Preparation ]----
// Initialise a gfshare context for producing shares

Loading…
Cancel
Save