diff --git a/iguana/exchanges/LP_commands.c b/iguana/exchanges/LP_commands.c index 7714e2d63..4357af2cb 100644 --- a/iguana/exchanges/LP_commands.c +++ b/iguana/exchanges/LP_commands.c @@ -599,10 +599,7 @@ version\n\ } #ifndef NOT_ETOMIC if (strcmp(coin, "ETOMIC") == 0) { - char eth_addr[100]; - bits256 privkey = LP_privkey("ETOMIC", ptr->smartaddr, ptr->taddr); - LP_etomic_priv2addr(eth_addr, privkey); - if (get_etomic_from_faucet(eth_addr, ptr->smartaddr) != 1) { + if (get_etomic_from_faucet(ptr->smartaddr) != 1) { return(clonestr("{\"error\":\"Could not get ETOMIC from faucet!\"}")); } } @@ -696,6 +693,13 @@ version\n\ { if ( (ptr= LP_coinsearch(coin)) != 0 ) { +#ifndef NOTETOMIC + if (strcmp(coin, "ETOMIC") == 0) { + if (get_etomic_from_faucet(ptr->smartaddr) != 1) { + return(clonestr("{\"error\":\"Could not get ETOMIC from faucet!\"}")); + } + } +#endif ptr->inactive = 0; return(jprint(LP_electrumserver(ptr,jstr(argjson,"ipaddr"),juint(argjson,"port")),1)); } else return(clonestr("{\"error\":\"cant find coind\"}")); diff --git a/iguana/exchanges/etomicswap/etomiccurl.c b/iguana/exchanges/etomicswap/etomiccurl.c index c6a493f33..a43e2c292 100644 --- a/iguana/exchanges/etomicswap/etomiccurl.c +++ b/iguana/exchanges/etomicswap/etomiccurl.c @@ -374,11 +374,10 @@ void unlock_send_tx_mutex() pthread_mutex_unlock(&sendTxMutex); } -uint8_t get_etomic_from_faucet(char *eth_addr, char *etomic_addr) +uint8_t get_etomic_from_faucet(char *etomic_addr) { char* string; cJSON *request = cJSON_CreateObject(); - cJSON_AddStringToObject(request, "ethAddress", eth_addr); cJSON_AddStringToObject(request, "etomicAddress", etomic_addr); string = cJSON_PrintUnformatted(request); char* requestResult = sendRequest(string, FAUCET_URL); diff --git a/iguana/exchanges/etomicswap/etomiccurl.h b/iguana/exchanges/etomicswap/etomiccurl.h index 6e5036739..2b765b150 100644 --- a/iguana/exchanges/etomicswap/etomiccurl.h +++ b/iguana/exchanges/etomicswap/etomiccurl.h @@ -50,7 +50,7 @@ uint64_t getEthBlockNumber(); uint64_t getGasPriceFromStation(uint8_t defaultOnErr); int32_t waitForConfirmation(char *txId); void unlock_send_tx_mutex(); -uint8_t get_etomic_from_faucet(char *eth_addr, char *etomic_addr); +uint8_t get_etomic_from_faucet(char *etomic_addr); #ifdef __cplusplus }