mirror of
https://github.com/corda/corda.git
synced 2025-02-02 01:08:09 +00:00
Encrypt transactions for local format as soon as they are received
This commit is contained in:
parent
e1a6b5fd09
commit
9a6b8d2417
@ -2,7 +2,7 @@
|
||||
# because some versions here need to be matched by app authors in
|
||||
# their own projects. So don't get fancy with syntax!
|
||||
|
||||
cordaVersion=4.8.5.6-CONCLAVE-SNAPSHOT
|
||||
cordaVersion=4.8.5.7-CONCLAVE-SNAPSHOT
|
||||
versionSuffix=
|
||||
gradlePluginsVersion=5.0.12
|
||||
kotlinVersion=1.2.71
|
||||
|
@ -111,6 +111,11 @@ abstract class ReceiveTransactionFlowBase<T> @JvmOverloads constructor(private v
|
||||
try {
|
||||
if (encrypted) {
|
||||
val validatedTxSvc = serviceHub.validatedTransactions
|
||||
val encryptedTxSvc = serviceHub.encryptedTransactionService
|
||||
|
||||
val usableEncryptedTransaction = encryptedTxSvc.encryptTransactionForLocal(
|
||||
encryptedTx ?: throw IllegalStateException("And encrypted transaction is required")
|
||||
)
|
||||
|
||||
val signedTxs = it.dependencies.mapNotNull {
|
||||
validatedTxId ->
|
||||
@ -123,16 +128,16 @@ abstract class ReceiveTransactionFlowBase<T> @JvmOverloads constructor(private v
|
||||
}.toSet()
|
||||
|
||||
val verifiableTx = EncryptedVerifiableTxAndDependencies(
|
||||
encryptedTx!!,
|
||||
usableEncryptedTransaction,
|
||||
signedTxs,
|
||||
encryptedTxs
|
||||
)
|
||||
|
||||
if (checkSufficientSignatures) {
|
||||
val encryptedAndVerifiedTx = serviceHub.encryptedTransactionService.enclaveVerifyWithSignatures(verifiableTx)
|
||||
val encryptedAndVerifiedTx = encryptedTxSvc.enclaveVerifyWithSignatures(verifiableTx)
|
||||
serviceHub.recordEncryptedTransactions(listOf(encryptedAndVerifiedTx))
|
||||
} else {
|
||||
serviceHub.encryptedTransactionService.enclaveVerifyWithoutSignatures(verifiableTx)
|
||||
encryptedTxSvc.enclaveVerifyWithoutSignatures(verifiableTx)
|
||||
}
|
||||
|
||||
it
|
||||
|
Loading…
x
Reference in New Issue
Block a user