I am running a geth full node on Rinkeby and testing ERC20 transactions. Recently I submitted two transactions and received transaction hashes for each of them, so I assumed I was good. But later on when looking at the geth log, I realized that both transactions failed because I didn't give enough gas.
Here is a gist of the transaction log snippet:
My program logic assumes that receiving a full hash for a tx submission means that the tx was good. But as you can see from the geth log, at 08:30:14 I got a full hash but 1 second later at 08:30:15 the announcement was discarded by a Peer and the EVM returns
err="out of gas".
The second transaction gets a full hash at 08:30:15 but it errors out 2 seconds later at 08:30:17 and doesn't make it into the block.
I then tried to search for these tx hashes but they were nowhere to be found, both locally and on Etherscan. Is this normal behavior? Is there a way to detect "out of gas" transactions programmatically, i.e. without tailing logs?