How can I check the status of the State (Consumed or Not Consumed) in Corda?
I downloaded Cordapp-example, executed "Create-iou" several times, then I referred to State information using the "ious" API, but I could not confirm the status.
You can check the metadata of the state to find out it's consumed or not. in the metadata there is an option to check if the state is consumed or unconsumed.
For example:
Vault.Page<YourState> results = rpcOps.vaultQueryByCriteria(linearCriteria, YourState.class);
results.getStatesMetadata().get(0).getStatus(); -> This will get you the status of the state
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With