Browse Source

Sleep on tx confirmation check only if it's not confirmed yet.

patch-3
Artem Pikulin 7 years ago
parent
commit
43b92c9be6
  1. 8
      iguana/exchanges/etomicswap/etomiccurl.c

8
iguana/exchanges/etomicswap/etomiccurl.c

@ -293,16 +293,18 @@ int32_t waitForConfirmation(char *txId)
EthTxReceipt receipt;
EthTxData txData;
do {
sleep(15);
printf("waiting for ETH txId to be confirmed: %s\n", txId);
receipt = getEthTxReceipt(txId);
if (receipt.confirmations < 1) {
txData = getEthTxData(txId);
if (txData.exists == 0) {
return(-1);
}
} else {
break;
}
} while (receipt.confirmations < 1);
printf("waiting for ETH txId to be confirmed: %s\n", txId);
sleep(15);
} while (1);
if (strcmp(receipt.status, "0x1") != 0) {
printf("ETH txid %s receipt status failed\n", txId);

Loading…
Cancel
Save