在 Corda 中,您可以在单个流中创建多个事务吗?
In Corda, can you create more than one transaction in a single flow?
我见过的所有 Corda 流程都只涉及单个交易的创建、签名和完成。是否可以在一个流程中创建、签署和完成多个交易?
是的。一个流可以创建零个、一个或多个事务。
您甚至可以在流中使用循环结构来创建多个事务:
while (cash > 0) {
createCashTransaction(5.DOLLARS)
cash -= 5.DOLLARS
}
或者使用条件逻辑来决定是否创建交易:
if (cash > 0) {
createCashTransaction(5.DOLLARS)
}
我见过的所有 Corda 流程都只涉及单个交易的创建、签名和完成。是否可以在一个流程中创建、签署和完成多个交易?
是的。一个流可以创建零个、一个或多个事务。
您甚至可以在流中使用循环结构来创建多个事务:
while (cash > 0) {
createCashTransaction(5.DOLLARS)
cash -= 5.DOLLARS
}
或者使用条件逻辑来决定是否创建交易:
if (cash > 0) {
createCashTransaction(5.DOLLARS)
}