diff --git a/basilisk/jumblr.c b/basilisk/jumblr.c index 50c279d2e..f2a7c59df 100755 --- a/basilisk/jumblr.c +++ b/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) { diff --git a/iguana/iguana777.h b/iguana/iguana777.h index a9b88c7b3..8e33594a5 100755 --- a/iguana/iguana777.h +++ b/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; diff --git a/iguana/main.c b/iguana/main.c index dbc632b66..304b32ecb 100755 --- a/iguana/main.c +++ b/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)); } diff --git a/iguana/tests/jumblrstatus b/iguana/tests/jumblrstatus new file mode 100755 index 000000000..6c1824244 --- /dev/null +++ b/iguana/tests/jumblrstatus @@ -0,0 +1,2 @@ +#!/bin/bash +curl --url "http://127.0.0.1:7778" --data "{\"agent\":\"jumblr\",\"method\":\"status\"}" diff --git a/includes/iguana_funcs.h b/includes/iguana_funcs.h index 43f997c75..e82603144 100755 --- a/includes/iguana_funcs.h +++ b/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