Corda:我如何检查消费或未消费

时间:2018-04-02 10:12:43

标签: corda

如何查看Corda中的状态(已消耗或未消耗)?

我下载了Cordapp-example,多次执行“Create-iou”,然后我使用“ious”API引用状态信息,但我无法确认状态。

1 个答案:

答案 0 :(得分:1)

您可以检查状态的元数据,以确定它是否已消耗。在元数据中有一个选项来检查状态是消耗还是未消耗。

例如:

Vault.Page<YourState> results = rpcOps.vaultQueryByCriteria(linearCriteria, YourState.class);
results.getStatesMetadata().get(0).getStatus(); -> This will get you the status of the state
相关问题