I want to limit transaction pending time to 5 seconds, after that the transaction considered as failed;

does --txpool.lifetime solve the problem ?


You can drop/reject transactions using Ethereal with an automated python script that encounters on every 5 seconds.

To understand more about Ethereal, Go through below link :

Releasing Stuck Ethereum Transactions

Hope this answer will help You.


Just to elaborate on Mahesh's answer.

Transactions can't be cancelled or marked as failed. Once you submit a transaction to the network there is no way to cancel it.

The only thing you can do it overwrite the transaction. Note that this is just a trick and in reality it just means that you send another transaction to the network with the same nonce. If the new transaction has higher gas price miners will probably include that in a block first. Once that transaction is mined the older transaction becomes invalid as a transaction with that nonce has already been mined.

  • I don't really want to cancel it, but I want that the js promise reject or resolve something – maroodb Oct 16 '19 at 12:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.