首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >广播旧事务将导致两个未使用状态。

广播旧事务将导致两个未使用状态。
EN

Stack Overflow用户
提问于 2018-07-19 04:55:19
回答 1查看 129关注 0票数 1

关于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 in vault_states设立未消费的vault_states--这既好又好。

如果银行在上述操作之后不正确地将Tx2发送给监管机构,那么监管机构将在B lifecycle记录相同UUID的两个未使用状态,并记录D lifecycle快照。这是预期的行为吗?

另一种情况

  1. 如果银行先发送Tx2,然后依次发送Tx4,则Tx2Tx4都未消耗。
  2. 如果银行先发送Tx2,然后按顺序发送Tx3,则Tx2将被消耗,Tx3未被消耗。

下面的代码片段

代码语言:javascript
运行
复制
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)
    }
}
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2018-07-19 09:10:41

这似乎是个窃听器。它在这里被跟踪:https://r3-cev.atlassian.net/browse/CORDA-1828

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/51414594

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档