在FinalityFlow 中,调用者使用以下行将经过公证的交易发送到所有状态的participants:
subFlow(SendTransactionFlow(session, notarised))
如果我们查看AbstractNode.installCoreFlows,我们会看到该节点为FinalityFlow 安装了一个名为FinalityHandler 的默认处理程序。 FinalityHandler 通过调用ReceiveTransactionFlow 来响应FinalityFlow 中对SendTransactionFlow 的调用。
在ReceiveTransactionFlow内部,我们可以看到节点解析了交易的依赖,验证了交易并检查了它的签名:
val stx = otherSideSession.receive<SignedTransaction>().unwrap {
subFlow(ResolveTransactionsFlow(it, otherSideSession))
it.verify(serviceHub, checkSufficientSignatures)
it
}
作为解决ResolveTransactionsFlow 中交易依赖关系的一部分,节点会验证每一个并检查其签名(默认情况下,verify 检查交易上的签名):
result.forEach {
it.verify(serviceHub)
serviceHub.recordTransactions(StatesToRecord.NONE, listOf(it))
}
如果公证人是验证公证人,公证人只会以这种方式走链。