<p><code>awaitTxConfirmed</code> is actually part of the off-chain code, so your computer is checking the chain to see if the transaction has become part of the ledger.</p>
<p>Sadly, right now <code>awaitTxConfirmed</code> does not know that a transaction has failed and if it did fail, your smart contact would be blocked, unless you introduce a logic to time out if your transaction is not included in the ledger for some amount of blocks for example.</p>
<p>However, I know the plutus team is working to solve this and we might have this functionality soon in Plutus.</p>

CC BY-SA 4.0
2021-05-31T12:15:33.530Z
2021-05-31T12:15:33.530Z
Marek Mahut - StakeNuts
<p>How to know if a transaction (tx) succeed or fail after <code>awaitTxConfirmed</code>? Is there any function to get a tx on-chain by <code>TxId</code>?</p>

<plutus><smart-contract>
How to know if a transaction (tx) succeed or failed after awaitTxConfirmed?
# How to know if a transaction (tx) succeed or failed after awaitTxConfirmed?

(Asked by: username_0 on 2021-05-30)

How to know if a transaction (tx) succeed or fail after `awaitTxConfirmed`? Is there any function to get a tx on-chain by `TxId`?

**Tags:** plutus, smart-contract

---

## 1 answers

### Answer by username_1 on 2021-05-31. Score: 4

`awaitTxConfirmed` is actually part of the off-chain code, so your computer is checking the chain to see if the transaction has become part of the ledger.

Sadly, right now `awaitTxConfirmed` does not know that a transaction has failed and if it did fail, your smart contact would be blocked, unless you introduce a logic to time out if your transaction is not included in the ledger for some amount of blocks for example.

However, I know the plutus team is working to solve this and we might have this functionality soon in Plutus.


---

