fix: Transaction error during not mined
issue
@@ -746,7 +746,7 @@ BOAT_RESULT BoatEthGetTransactionReceipt(BoatEthTx *tx_ptr)
}
result = BoatEthPraseRpcResponseResult(tx_status_str, "status",
&tx_ptr->wallet_ptr->web3intf_context_ptr->web3_result_string_buf);
- if (result != BOAT_SUCCESS)
+ if (result != BOAT_SUCCESS && result != BOAT_ERROR_WEB3_JSON_GETOBJ_FAIL)
{
BoatLog(BOAT_LOG_NORMAL, "Fail to get transaction receipt due to RPC failure.");
result = BOAT_ERROR_WALLET_RESULT_PRASE_FAIL;
@@ -757,7 +757,7 @@ BOAT_RESULT BoatEthGetTransactionReceipt(BoatEthTx *tx_ptr)
// tx_status_str == "": the transaction is pending
// tx_status_str == "0x1": the transaction is successfully mined
// tx_status_str == "0x0": the transaction fails
- if (tx_ptr->wallet_ptr->web3intf_context_ptr->web3_result_string_buf.field_ptr[0] != '\0')
+ if (result != BOAT_ERROR_WEB3_JSON_GETOBJ_FAIL)
{
if (strcmp((BCHAR*)tx_ptr->wallet_ptr->web3intf_context_ptr->web3_result_string_buf.field_ptr, "0x1") == 0)
{
@@ -766,8 +766,12 @@ BOAT_RESULT BoatEthGetTransactionReceipt(BoatEthTx *tx_ptr)
}
else
{
- BoatLog(BOAT_LOG_NORMAL, "Transaction has not got mined, requery after %d seconds.", BOAT_ETH_MINE_INTERVAL);
+ BoatLog(BOAT_LOG_NORMAL, "Transaction fails.");
+ }
}
+ else
+ {
+ BoatLog(BOAT_LOG_NORMAL, "Transaction has not got mined, requery after %d seconds.", BOAT_ETH_MINE_INTERVAL);
}
tx_mined_timeout -= BOAT_ETH_MINE_INTERVAL;
