From 15709d0c59c2415f9c703453527a7de6238710bb Mon Sep 17 00:00:00 2001 From: Artem Pikulin Date: Sat, 17 Mar 2018 19:32:38 +0700 Subject: [PATCH] Rollback get nonce and sendRawTxWaitConfirm changes. --- iguana/exchanges/etomicswap/etomiccurl.c | 11 +++-------- iguana/exchanges/etomicswap/etomiccurl.h | 2 +- 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/iguana/exchanges/etomicswap/etomiccurl.c b/iguana/exchanges/etomicswap/etomiccurl.c index 2dabb67f9..ed4094bee 100644 --- a/iguana/exchanges/etomicswap/etomiccurl.c +++ b/iguana/exchanges/etomicswap/etomiccurl.c @@ -114,17 +114,12 @@ char* sendRawTxWaitConfirm(char* rawTx) cJSON_Delete(params); char *txId = NULL; if (resultJson != NULL && is_cJSON_String(resultJson) && resultJson->valuestring != NULL) { - char* tmp = resultJson->valuestring; - txId = (char *) malloc(strlen(tmp) + 1); - strcpy(txId, tmp); - } - /*if (resultJson != NULL && is_cJSON_String(resultJson) && resultJson->valuestring != NULL) { char* tmp = resultJson->valuestring; if (waitForConfirmation(tmp) > 0) { txId = (char *) malloc(strlen(tmp) + 1); strcpy(txId, tmp); } - }*/ + } cJSON_Delete(resultJson); pthread_mutex_unlock(&sendTxMutex); return txId; @@ -156,9 +151,9 @@ int64_t getNonce(char* address) }; cJSON *params = cJSON_CreateArray(); cJSON_AddItemToArray(params, cJSON_CreateString(address)); - //cJSON_AddItemToArray(params, cJSON_CreateString("pending")); + cJSON_AddItemToArray(params, cJSON_CreateString("pending")); int64_t nonce = -1; - cJSON *nonceJson = sendRpcRequest("parity_nextNonce", params); + cJSON *nonceJson = sendRpcRequest("eth_getTransactionCount", params); cJSON_Delete(params); if (nonceJson != NULL && is_cJSON_String(nonceJson) && nonceJson != NULL) { nonce = (int64_t) strtol(nonceJson->valuestring, NULL, 0); diff --git a/iguana/exchanges/etomicswap/etomiccurl.h b/iguana/exchanges/etomicswap/etomiccurl.h index 3d1e02b7e..6e5c87d47 100644 --- a/iguana/exchanges/etomicswap/etomiccurl.h +++ b/iguana/exchanges/etomicswap/etomiccurl.h @@ -12,7 +12,7 @@ extern "C"{ #endif #ifdef ETOMIC_TESTNET -#define ETOMIC_URL "http://195.201.0.6:8545" +#define ETOMIC_URL "https://ropsten.infura.io/y07GHxUyTgeN2mdfOonu" #define DEFAULT_GAS_PRICE 100 #else #define ETOMIC_URL "https://mainnet.infura.io/y07GHxUyTgeN2mdfOonu"