jl777
7 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with
11 additions and
7 deletions
-
iguana/exchanges/LP_include.h
-
iguana/exchanges/LP_socket.c
-
iguana/exchanges/LP_transaction.c
-
iguana/exchanges/LP_utxo.c
|
|
@ -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 |
|
|
|
|
|
@ -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(); |
|
|
|
|
|
@ -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); |
|
|
|
} |
|
|
@ -716,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; |
|
|
|
|
|
@ -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) |
|
|
@ -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); |
|
|
|