Reputation: 39
How can we identify whether a transaction contains attachment.
if there is an attachment how can we retrieve the hash id from the transaction
Upvotes: 0
Views: 37
Reputation: 58
In Corda 4.0 (Kotlin) you can do
val tx = serviceHub.validatedTransactions.getTransaction(signedTx.id)
To access a transaction's attachment hash.
If you want to get the actual attachment, you should be able to do
tx.toLedgerTransaction(serviceHub)
To convert tx
from a validatedTransaction
to a LedgerTransaction
(that should allow you to access the list of attachments).
Upvotes: 0