sakeer
sakeer

Reputation: 39

How can we identify whether a transaction contains attachements in corda

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

Answers (1)

VCAMP
VCAMP

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

Related Questions