From c1654d3710230608a8f1401c993ce3d2a3faabfb Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 6 Nov 2017 22:02:30 +0200 Subject: [PATCH 1/6] Test --- iguana/exchanges/LP_transaction.c | 4 ++++ iguana/exchanges/LP_utxo.c | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_transaction.c b/iguana/exchanges/LP_transaction.c index 87b395b8a..fce01d038 100644 --- a/iguana/exchanges/LP_transaction.c +++ b/iguana/exchanges/LP_transaction.c @@ -647,7 +647,11 @@ char *basilisk_swap_bobtxspend(int32_t dustcombine,bits256 *signedtxidp,uint64_t memset(items,0,sizeof(items)); more = LP_dustcombine(items,dustcombine,coin); if ( more != 0 ) + { printf("%s dustcombine.%d -> %.8f (%s) + (%s)\n",coin->symbol,dustcombine,dstr(more),items[0] != 0 ? jprint(items[0],0) : "",items[1] != 0 ? jprint(items[1],0) : ""); +memset(items,0,sizeof(items)); +more = 0 ; + } value += more; dustcombine = (items[0] != 0) + (items[1] != 0); } diff --git a/iguana/exchanges/LP_utxo.c b/iguana/exchanges/LP_utxo.c index 760641da8..a1e6ce758 100644 --- a/iguana/exchanges/LP_utxo.c +++ b/iguana/exchanges/LP_utxo.c @@ -970,8 +970,8 @@ uint64_t LP_dustcombine(cJSON *items[2],int32_t dustcombine,struct iguana_info * struct LP_address *ap=0; struct LP_address_utxo *up,*tmp,*min0,*min1; cJSON *txobj; if ( coin == 0 || coin->electrum != 0 || dustcombine <= 0 || dustcombine > 2 ) return(0); -return(0); min1 = min0 = 0; + printf("LP_dustcombine\n"); if ( (ap= _LP_addressfind(coin,coin->smartaddr)) != 0 ) { DL_FOREACH_SAFE(ap->utxos,up,tmp) From d7a9dc306e7d23dca5ce0f58e1472ac621f40037 Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 6 Nov 2017 22:08:45 +0200 Subject: [PATCH 2/6] Test --- iguana/exchanges/LP_include.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_include.h b/iguana/exchanges/LP_include.h index 70dc2248b..cd39393ff 100644 --- a/iguana/exchanges/LP_include.h +++ b/iguana/exchanges/LP_include.h @@ -47,8 +47,8 @@ void emscripten_usleep(int32_t x); // returns immediate, no sense for sleeping #define LP_MIN_PEERS 8 #define LP_MAX_PEERS 32 -#define LP_MAXDESIRED_UTXOS 128 -#define LP_MINDESIRED_UTXOS 64 +#define LP_MAXDESIRED_UTXOS 8 +#define LP_MINDESIRED_UTXOS 16 // RTmetrics #define LP_RTMETRICS_TOPGROUP 1.01 From 8308444e64f037da3762c71ef8ad3a78bc2b7b5a Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 6 Nov 2017 22:21:54 +0200 Subject: [PATCH 3/6] Activate dust combine --- iguana/exchanges/LP_transaction.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_transaction.c b/iguana/exchanges/LP_transaction.c index fce01d038..0c55bc5fd 100644 --- a/iguana/exchanges/LP_transaction.c +++ b/iguana/exchanges/LP_transaction.c @@ -649,8 +649,8 @@ char *basilisk_swap_bobtxspend(int32_t dustcombine,bits256 *signedtxidp,uint64_t if ( more != 0 ) { printf("%s dustcombine.%d -> %.8f (%s) + (%s)\n",coin->symbol,dustcombine,dstr(more),items[0] != 0 ? jprint(items[0],0) : "",items[1] != 0 ? jprint(items[1],0) : ""); -memset(items,0,sizeof(items)); -more = 0 ; +//memset(items,0,sizeof(items)); +//more = 0 ; } value += more; dustcombine = (items[0] != 0) + (items[1] != 0); From 7d3bff1544286b25dcf1e108184b3f741c3f3e8d Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 6 Nov 2017 22:42:17 +0200 Subject: [PATCH 4/6] Test --- iguana/exchanges/LP_transaction.c | 1 + iguana/exchanges/LP_utxo.c | 4 +--- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/iguana/exchanges/LP_transaction.c b/iguana/exchanges/LP_transaction.c index 0c55bc5fd..7a8ec872b 100644 --- a/iguana/exchanges/LP_transaction.c +++ b/iguana/exchanges/LP_transaction.c @@ -720,6 +720,7 @@ char *basilisk_swap_bobtxspend(int32_t dustcombine,bits256 *signedtxidp,uint64_t V[i+1].suppress_pubkeys = 0; V[i+1].ignore_cltverr = 0; V[i+1].N = V[i+1].M = 1; + jaddistr(privkeys,wifstr); } if ( redeemlen != 0 ) memcpy(V[0].p2shscript,redeemscript,redeemlen), V[0].p2shlen = redeemlen; diff --git a/iguana/exchanges/LP_utxo.c b/iguana/exchanges/LP_utxo.c index a1e6ce758..2ccef6517 100644 --- a/iguana/exchanges/LP_utxo.c +++ b/iguana/exchanges/LP_utxo.c @@ -1061,9 +1061,7 @@ void LP_unspents_load(char *symbol,char *addr) if ( (retjson= cJSON_Parse(arraystr)) != 0 ) { printf("PROCESS UNSPENTS %s\n",arraystr); - if ( electrum_process_array(coin,coin->electrum,coin->smartaddr,retjson,1) == 0 ) - printf("error electrum_process_array\n"); - else printf("processed %s\n",arraystr); + electrum_process_array(coin,coin->electrum,coin->smartaddr,retjson,1); free_json(retjson); } free(arraystr); From c97b78bf89b786d70b052aa1cf1db4ea67c80ea4 Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 6 Nov 2017 22:51:15 +0200 Subject: [PATCH 5/6] Test --- iguana/exchanges/LP_transaction.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_transaction.c b/iguana/exchanges/LP_transaction.c index 7a8ec872b..ec1f2549e 100644 --- a/iguana/exchanges/LP_transaction.c +++ b/iguana/exchanges/LP_transaction.c @@ -649,8 +649,8 @@ char *basilisk_swap_bobtxspend(int32_t dustcombine,bits256 *signedtxidp,uint64_t if ( more != 0 ) { printf("%s dustcombine.%d -> %.8f (%s) + (%s)\n",coin->symbol,dustcombine,dstr(more),items[0] != 0 ? jprint(items[0],0) : "",items[1] != 0 ? jprint(items[1],0) : ""); -//memset(items,0,sizeof(items)); -//more = 0 ; +memset(items,0,sizeof(items)); +more = 0 ; } value += more; dustcombine = (items[0] != 0) + (items[1] != 0); From aec5287830934d654b29ca4a9c84b5b313553c97 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 7 Nov 2017 02:28:39 +0200 Subject: [PATCH 6/6] Disable disabling electrum --- iguana/exchanges/LP_socket.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_socket.c b/iguana/exchanges/LP_socket.c index dafac13b2..28b7d2e16 100644 --- a/iguana/exchanges/LP_socket.c +++ b/iguana/exchanges/LP_socket.c @@ -1024,7 +1024,8 @@ cJSON *LP_electrumserver(struct iguana_info *coin,char *ipaddr,uint16_t port) struct electrum_info *ep; int32_t already; cJSON *retjson; if ( ipaddr == 0 || ipaddr[0] == 0 || port == 0 ) { - coin->electrum = 0; + //coin->electrum = 0; + printf("would have disabled %s electrum here\n",coin->symbol); return(cJSON_Parse("{\"result\":\"success\",\"status\":\"electrum mode disabled, now in native coin mode\"}")); } retjson = cJSON_CreateObject();