在Corda 3.0 Postgres 9.6。
假设有一个
LinearState
在已转换为
A lifecycle in Tx1 -> B lifecycle in Tx2 -> C lifecycle in Tx3 -> D lifecycle in Tx4
是的。
我有一个空保险库的监管者。当银行发出
Tx4
给监管机构调节器将没有消耗
线性状态
在
D lifecycle
在里面
vault_states
-很好也很好。
如果银行错误地发送
Tx2
在上述操作之后,监管者将记录同一UUID的两个未使用状态
B lifecycle
,和
D生命周期
快照。这是预期的行为吗?
另一种情况
-
如果银行
TX2型
首先然后
TX4
按顺序,两个
TX2型
和
TX4型
未消耗
-
如果银行
TX2型
首先然后
Tx3
按顺序,
TX2型
将被消耗
TX3
未消耗。
下面的代码段
class ReportToCounterparty(
private val regulator: Party,
private val signedTx: SignedTransaction) : FlowLogic<SignedTransaction>() {
@Suspendable
override fun call(): SignedTransaction {
val session = initiateFlow(regulator)
subFlow(IdentitySyncFlow.Send(session, signedTx.tx))
subFlow(SendTransactionFlow(session, signedTx))
return session.receive<SignedTransaction>().unwrap { it }
}
}
@InitiatedBy(ReportToCounterparty::class)
class ReceiveReportedTransaction(private val otherSideSession: FlowSession) : FlowLogic<Unit>() {
@Suspendable
override fun call() {
// TODO: add error handling
subFlow(IdentitySyncFlow.Receive(otherSideSession))
val recorded = subFlow(ReceiveTransactionFlow(otherSideSession, true, StatesToRecord.ALL_VISIBLE))
otherSideSession.send(recorded)
}
}